That's a handy function

This commit is contained in:
Zergling_man 2021-12-12 19:58:36 +11:00
parent 1567881e5f
commit d7dcd02ede

View File

@ -21,7 +21,7 @@ class Contact(models.Model):
priority=models.IntegerField() priority=models.IntegerField()
def save(self,*args,**kwargs): def save(self,*args,**kwargs):
a=Updates.objects.get(page='contact') a,_=Updates.objects.get_or_create(page='contact')
a.date=date.today() a.date=date.today()
a.save() a.save()
super().save(*args,**kwargs) super().save(*args,**kwargs)