Skip to content

Commit

Permalink
Make deleted fields nullable, add isDeleted property
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianRamsay committed Jul 24, 2024
1 parent defd38f commit cd70ee5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@ class Event(baseModel):
contactName = CharField(null=True)
program = ForeignKeyField(Program)
isCanceled = BooleanField(default=False)
deletionDate = DateTimeField()
deletedBy = TextField()
deletionDate = DateTimeField(null=True)
deletedBy = TextField(null=True)

_spCache = "Empty"

def __str__(self):
return f"{self.id}: {self.description}"

@property
def isDeleted(self):
return bool(self.deletionDate)

@property
def noProgram(self):
return not self.program_id
Expand Down

0 comments on commit cd70ee5

Please sign in to comment.