- Django 2 Web Development Cookbook
- Jake Kronika Aidas Bendoraitis
- 77字
- 2021-06-10 19:31:33
Creating a model mixin to handle creation and modification dates
It is common to include timestamps in your models, for the creation and modification of your model instances. In this recipe, you will learn how to create a simple model mixin that saves the creation and modification dates and times for your model. Using such a mixin will ensure that all of the models use the same field names for the timestamps, and have the same behaviors.