mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-16 04:13:34 -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.
|
# 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):
|
||||||
"""returns a List of Episodes under this Season"""
|
"""returns a List of Episodes under this Season"""
|
||||||
|
|||||||
Reference in New Issue
Block a user