fixed BUG-31 - ordering multiple series for a book

This commit is contained in:
2023-07-05 21:28:49 +10:00
parent 5a81afd3d2
commit 7edc4babd9
2 changed files with 2 additions and 5 deletions

3
BUGs
View File

@@ -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 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?) 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

View File

@@ -138,8 +138,8 @@ class Book(db.Model):
title = db.Column(db.String(100), unique=True, nullable=False) title = db.Column(db.String(100), unique=True, nullable=False)
publisher = db.Column(db.Integer, db.ForeignKey('publisher.id')) publisher = db.Column(db.Integer, db.ForeignKey('publisher.id'))
genre = db.relationship('Genre', secondary=Book_Genre_Link.__table__ ) genre = db.relationship('Genre', secondary=Book_Genre_Link.__table__ )
loan = db.relationship('Loan', secondary=Book_Loan_Link.__table__); loan = db.relationship('Loan', secondary=Book_Loan_Link.__table__)
series = db.relationship('Series', secondary=Book_Series_Link.__table__); series = db.relationship('Series', secondary=Book_Series_Link.__table__,order_by=Series.num_books)
bsl = db.relationship('Book_Series_Link', overlaps="series" ) bsl = db.relationship('Book_Series_Link', overlaps="series" )
year_published = db.Column(db.Integer) year_published = db.Column(db.Integer)
condition = db.Column(db.Integer, db.ForeignKey('condition.id')) condition = db.Column(db.Integer, db.ForeignKey('condition.id'))