mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-15 08:13:29 -06:00
create a Season wide builder
This commit is contained in:
@@ -32,6 +32,16 @@ class Season(db.Model):
|
||||
# Regardless of whether it existended before hand, the episode will be built.
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def create_all(build=True):
|
||||
"""creates new Season objects and runs build() on them"""
|
||||
for i in range(1, 10):
|
||||
if Season.query.get(i) is None:
|
||||
s = Season(id=i)
|
||||
db.session.add(s)
|
||||
s.build()
|
||||
db.session.commit()
|
||||
|
||||
@property
|
||||
def episodes(self):
|
||||
"""returns a List of Episodes under this Season"""
|
||||
|
||||
Reference in New Issue
Block a user