diff --git a/author.py b/author.py index acf6e79..732d8c3 100644 --- a/author.py +++ b/author.py @@ -7,8 +7,8 @@ from __main__ import db, app, ma ################################################################################ class Author(db.Model): id = db.Column(db.Integer, unique=True, nullable=False, primary_key=True) - firstnames = db.Column(db.String(50), unique=False, nullable=False) surname = db.Column(db.String(30), unique=False, nullable=False) + firstnames = db.Column(db.String(50), unique=False, nullable=False) def __repr__(self): return "".format(self.id,self.firstnames, self.surname) @@ -17,7 +17,9 @@ class Author(db.Model): # Helper class that inherits a .dump() method to turn class Author into json / useful in jinja2 ################################################################################ class AuthorSchema(ma.SQLAlchemyAutoSchema): - class Meta: model = Author + class Meta: + model = Author + ordered = True ################################################################################ # Helper class that defines a form for author, used to make html
, with field validation (via wtforms)