1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-19 12:59:36 +02:00

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: