question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Access to relationship model

See original GitHub issue

Hi,


author = Author(name='Chuck Paluhniuk')
book = Book(title='Fight Club', author=author)
session.add(author)
session.add(book)
session.commit()

author_schema.dump(author).data

output model book:

# {'books': [123], 'id': 321, 'name': 'Chuck Paluhniuk'}

how to access to model books if i set list model like ,

lst = ses.query(author ).all()
author_schema.dump(lst).data

output :

# {'books': [123], 'id': 321, 'name': 'Chuck Paluhniuk'}

but i need access to model book?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
whoiswescommented, Mar 10, 2016

Change

author_schema.dump(lst).data

to

author_schema.dump(lst, many=True).data

???

1reaction
xargcommented, Apr 11, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Open Up The Entity Relationship Diagram In Access
How To Open Up The Entity Relationship Diagram In Access ; Click the Relationships button which can be found in the Relationships group...
Read more >
Guide to table relationships
To view your table relationships, click Relationships on the Database Tools tab. The Relationships window opens and displays any existing relationships. If no ......
Read more >
How to Make an ERD in Access
An ERD shows a visual representation of primary and foreign keys, which are the columns used to link tables. Microsoft Access includes a...
Read more >
How to Create a Database Diagram in Access
Screenshot of Access with the Relationships button highlighted. Launch the Relationships Window. Click Relationships from the Database Tools tab in the Ribbon.
Read more >
MS Access Lab 3 Topic: Relationships in ER Diagram and ...
Why Define Relationships? • Relationships in ER Diagram vs. Relationships in MS Access. • Creating Relationships Between Tables. → One-to-Many Relationship ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found