File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
flask-connexion-rest-part-3 Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,10 @@ class PersonSchema(ma.ModelSchema):
3636 class Meta :
3737 model = Person
3838 sqla_session = db .session
39- notes = fields .Nested ('PersonNotesSchema ' , default = [], many = True )
39+ notes = fields .Nested ('PersonNoteSchema ' , default = [], many = True )
4040
4141
42- class PersonNotesSchema (ma .ModelSchema ):
42+ class PersonNoteSchema (ma .ModelSchema ):
4343 """
4444 This class exists to get around a recursion issue
4545 """
@@ -53,10 +53,10 @@ class NoteSchema(ma.ModelSchema):
5353 class Meta :
5454 model = Note
5555 sqla_session = db .session
56- person = fields .Nested ('NotesPersonSchema ' , default = None )
56+ person = fields .Nested ('NotePersonSchema ' , default = None )
5757
5858
59- class NotesPersonSchema (ma .ModelSchema ):
59+ class NotePersonSchema (ma .ModelSchema ):
6060 """
6161 This class exists to get around a recursion issue
6262 """
Original file line number Diff line number Diff line change @@ -36,10 +36,9 @@ def read_one(person_id):
3636 person = Person .query \
3737 .filter (Person .person_id == person_id ) \
3838 .outerjoin (Note ) \
39- .options (db .joinedload (Person .notes )) \
4039 .one_or_none ()
4140
42- # Did we find a person?
41+ # Did we find a person?
4342 if person is not None :
4443
4544 # Serialize the data for the response
You can’t perform that action at this time.
0 commit comments