Skip to content

Instantly share code, notes, and snippets.

View cristianjs19's full-sized avatar

Cristian S. cristianjs19

  • Mendoza, Argentina
View GitHub Profile
class Foo(models.Model):
status = models.CharField()
expiring_date = models.DateField()
def is_active(self):
today = datetime.date.today()
if today > self.expiring_date:
self.status = "expired"
self.save()