공부
[Django] created_at, updated_at
승가비
2020. 7. 9. 02:35
728x90
class MyModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
https://stackoverflow.com/questions/3429878/automatic-creation-date-for-django-model-form-objects
Automatic creation date for Django model form objects?
What's the best way to set a creation date for an object automatically, and also a field that will record when the object was last updated? models.py: created_at = models.DateTimeField(False, True,
stackoverflow.com
728x90