Код: Выделить всё
class AuthorModel(db.Model):
books = db.relationship("BookModel", backref="authors", lazy=True)
def bookCount(self):
return self.books.count()
Код: Выделить всё
TypeError list.count() takes exactly one argument (0 given)
Подробнее здесь: https://stackoverflow.com/questions/693 ... sqlalchemy