From 8284750e94df8ec1750ae44ba4474b8790d96f8f Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Tue, 26 Sep 2023 14:03:15 +0200 Subject: [PATCH] Register all models with reversion --- apis_ontology/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apis_ontology/models.py b/apis_ontology/models.py index b366f98..e5a343c 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -1,3 +1,4 @@ +import reversion from django.db import models from apis_core.apis_entities.models import AbstractEntity from apis_core.core.models import LegacyDateMixin @@ -60,14 +61,17 @@ class Title(models.Model): name = models.CharField(max_length=255, blank=True) +@reversion.register(follow=["rootobject_ptr"]) class Event(LegacyStuffMixin, LegacyDateMixin, FixLegacyDateMixin, AbstractEntity): kind = models.CharField(max_length=255, blank=True) +@reversion.register(follow=["rootobject_ptr"]) class Institution(LegacyStuffMixin, LegacyDateMixin, FixLegacyDateMixin, AbstractEntity): kind = models.CharField(max_length=255, blank=True) +@reversion.register(follow=["rootobject_ptr"]) class Person(LegacyStuffMixin, LegacyDateMixin, FixLegacyDateMixin, AbstractEntity): GENDER_CHOICES = ( ("female", "female"), @@ -80,11 +84,13 @@ class Person(LegacyStuffMixin, LegacyDateMixin, FixLegacyDateMixin, AbstractEnti gender = models.CharField(max_length=15, choices=GENDER_CHOICES, blank=True, null=True) +@reversion.register(follow=["rootobject_ptr"]) class Place(LegacyStuffMixin, LegacyDateMixin, FixLegacyDateMixin, AbstractEntity): kind = models.CharField(max_length=255, blank=True) lat = models.FloatField(blank=True, null=True, verbose_name="latitude") lng = models.FloatField(blank=True, null=True, verbose_name="longitude") +@reversion.register(follow=["rootobject_ptr"]) class Work(LegacyStuffMixin, LegacyDateMixin, FixLegacyDateMixin, AbstractEntity): kind = models.CharField(max_length=255, blank=True)