| 33 | |
| 34 | |
| 35 | class QuoteSchema(Schema): |
| 36 | id = fields.Int(dump_only=True) |
| 37 | author = fields.Nested(AuthorSchema, validate=must_not_be_blank) |
| 38 | content = fields.Str(required=True, validate=must_not_be_blank) |
| 39 | posted_at = fields.DateTime(dump_only=True) |
| 40 | book_name = fields.Str() |
| 41 | page_number = fields.Float() |
| 42 | line_number = fields.Float() |
| 43 | col_number = fields.Float() |
| 44 | |
| 45 | @post_dump |
| 46 | def add_full_name(self, data, **kwargs): |
| 47 | data["author_full"] = "{}, {}".format( |
| 48 | data["author"]["last"], data["author"]["first"] |
| 49 | ) |
| 50 | return data |
| 51 | |
| 52 | |
| 53 | class Author: |
no outgoing calls
no test coverage detected
searching dependent graphs…