Hi,
i'm currently having some beginner issues with one-to-many relations. Given the following scheme:
class Manager(Table):
id = PrimaryKey()
name = Varchar()
class Band(Table):
id = PrimaryKey()
name = Varchar()
manager = ForeignKey(references=Manager)
popularity = Integer()
How can I access all Bands a Manager manages?
So something like bandsAManagerManages = Manager.bands
Is there some automatic support for such things or do I need to write a function with a subquery in the Manager table (... .where(manager=self.id)?
Hi,
i'm currently having some beginner issues with one-to-many relations. Given the following scheme:
How can I access all Bands a Manager manages?
So something like
bandsAManagerManages = Manager.bandsIs there some automatic support for such things or do I need to write a function with a subquery in the Manager table (... .where(manager=self.id)?