filter out invalid schedule items
This commit is contained in:
parent
fc02f8cafb
commit
6caa29e0c9
4 changed files with 44 additions and 23 deletions
|
@ -68,6 +68,14 @@ class Schedule(models.Model):
|
|||
return self.instance.ends
|
||||
return self.ends
|
||||
|
||||
@property
|
||||
def is_valid(self):
|
||||
"""
|
||||
A schedule item is valid if it starts before the end of the show instance
|
||||
it is in
|
||||
"""
|
||||
return self.starts < self.instance.ends
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_schedule"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue