Skip to content

models

django_spire.history.models

HistoryEvent

Bases: Model

content_type = models.ForeignKey(ContentType, related_name='history_events', related_query_name='history_event', on_delete=(models.CASCADE), editable=False) class-attribute instance-attribute

object_id = models.PositiveIntegerField(editable=False) class-attribute instance-attribute

content_object = GenericForeignKey('content_type', 'object_id') class-attribute instance-attribute

event = models.CharField(max_length=4, choices=(HistoryEventChoices.choices)) class-attribute instance-attribute

created_datetime = models.DateTimeField(default=localtime) class-attribute instance-attribute

event_verbose property

Meta

db_table = 'django_spire_history_event' class-attribute instance-attribute
verbose_name = 'History Event' class-attribute instance-attribute
verbose_name_plural = 'History Events' class-attribute instance-attribute

__str__

Source code in django_spire/history/models.py
def __str__(self) -> str:
    return f'{self.content_object} - {self.event_verbose}'