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:
@@ -31,6 +31,16 @@ class Season(db.Model):
|
|||||||
else:
|
else:
|
||||||
# Regardless of whether it existended before hand, the episode will be built.
|
# Regardless of whether it existended before hand, the episode will be built.
|
||||||
pass
|
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
|
@property
|
||||||
def episodes(self):
|
def episodes(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user