diff --git a/BUGs b/BUGs index 325b5eb..e546aa0 100644 --- a/BUGs +++ b/BUGs @@ -4,6 +4,3 @@ BUG-7: if you remove a series from a book, it won't appear in the series drop-d BUG-30: failed to add a book with 2 x same author (need to catch error or maybe mess with author list to remove duplicate potentials?) - -BUG-31: series does not have 'series_num', so a book in 2 series, means he ordering is not explicit - -> NEED TO display them in order of smallest num_books first diff --git a/main.py b/main.py index 26e4977..2a0a665 100644 --- a/main.py +++ b/main.py @@ -138,8 +138,8 @@ class Book(db.Model): title = db.Column(db.String(100), unique=True, nullable=False) publisher = db.Column(db.Integer, db.ForeignKey('publisher.id')) genre = db.relationship('Genre', secondary=Book_Genre_Link.__table__ ) - loan = db.relationship('Loan', secondary=Book_Loan_Link.__table__); - series = db.relationship('Series', secondary=Book_Series_Link.__table__); + loan = db.relationship('Loan', secondary=Book_Loan_Link.__table__) + series = db.relationship('Series', secondary=Book_Series_Link.__table__,order_by=Series.num_books) bsl = db.relationship('Book_Series_Link', overlaps="series" ) year_published = db.Column(db.Integer) condition = db.Column(db.Integer, db.ForeignKey('condition.id'))