mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-15 00:13:23 -06:00
create a Season wide builder
This commit is contained in:
@@ -31,6 +31,16 @@ class Season(db.Model):
|
||||
else:
|
||||
# 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):
|
||||
|
||||
Reference in New Issue
Block a user