Skip to content

Commit

Permalink
Register all models with reversion
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Sep 26, 2023
1 parent 6140791 commit 8284750
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apis_ontology/models.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"),
Expand All @@ -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)

0 comments on commit 8284750

Please sign in to comment.