core.mixins.TimestampModelMixin module¶
Module with the TimestampModelMixin.
- class core.mixins.TimestampModelMixin.TimestampModelMixin(*args, **kwargs)[source]¶
Bases:
ModelMixin adding creation and update timestamps to a model class.
- created¶
The datetime the model instance was created. Is set automatically.
- updated¶
The datetime the model instance entry was last updated. Is set automatically.
- class Meta[source]¶
Bases:
objectMetadata class for the mixin, abstract to avoid makemigrations picking it up.
- abstract = False¶
- get_latest_by = 'created'¶
- _meta = <Options for TimestampModelMixin>¶
- get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)¶
- get_next_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=True, **kwargs)¶
- get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)¶
- get_previous_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=False, **kwargs)¶