created_at and updated_at fields

This commit is contained in:
Sean Morley
2024-07-19 09:05:47 -04:00
parent 4abaaa5fb3
commit c6633a17cb
11 changed files with 81 additions and 39 deletions

View File

@@ -36,6 +36,7 @@ class Adventure(models.Model):
latitude = models.DecimalField(max_digits=9, decimal_places=6, null=True, blank=True)
collection = models.ForeignKey('Collection', on_delete=models.CASCADE, blank=True, null=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
def clean(self):
if self.collection: