Skip to content

models

django_spire.knowledge.entry.version.models

EntryVersion

Bases: HistoryModelMixin

entry = models.ForeignKey('Entry', on_delete=(models.CASCADE), related_name='versions', related_query_name='version') class-attribute instance-attribute

author = models.ForeignKey(AuthUser, on_delete=(models.CASCADE), related_name='entry_versions', related_query_name='entry_version') class-attribute instance-attribute

published_datetime = models.DateTimeField(blank=True, null=True) class-attribute instance-attribute

last_edit_datetime = models.DateTimeField(default=now) class-attribute instance-attribute

status = models.CharField(max_length=32, choices=EntryVersionStatusChoices, default=(EntryVersionStatusChoices.DRAFT)) class-attribute instance-attribute

objects = EntryVersionQuerySet.as_manager() class-attribute instance-attribute

services = EntryVersionService() class-attribute instance-attribute

Meta

verbose_name = 'Entry Version' class-attribute instance-attribute
verbose_name_plural = 'Entry Versions' class-attribute instance-attribute
db_table = 'django_spire_knowledge_entry_version' class-attribute instance-attribute

is_published

Source code in django_spire/knowledge/entry/version/models.py
def is_published(self) -> bool:
    return self.status == EntryVersionStatusChoices.PUBLISHED