Skip to content

Commit

Permalink
chore(history): remove not used reversion plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
sennierer authored and b1rger committed Mar 28, 2024
1 parent 1c8550d commit 4da4a08
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
39 changes: 0 additions & 39 deletions apis_core/apis_entities/serializers_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.db.models.query import QuerySet
from django.urls import reverse
from rest_framework import serializers
from reversion.models import Version


base_uri = getattr(settings, "APIS_BASE_URI", "http://apis.info")
Expand Down Expand Up @@ -39,25 +38,6 @@ class EntitySerializer(serializers.Serializer):
id = serializers.IntegerField()
url = serializers.SerializerMethodField(method_name="add_url")
uris = EntityUriSerializer(source="uri_set", many=True)
revisions = serializers.SerializerMethodField(method_name="add_revisions")

def add_revisions(self, obj):
ver = Version.objects.get_for_object(obj)
res = []
for v in ver:
usr_1 = getattr(v.revision, "user", None)
if usr_1 is not None:
usr_1 = usr_1.username
else:
usr_1 = "Not specified"
res.append(
{
"id": v.id,
"date_created": v.revision.date_created,
"user_created": usr_1,
}
)
return res

def add_relations(self, obj):
res = {}
Expand Down Expand Up @@ -163,25 +143,6 @@ class RelationEntitySerializer(serializers.Serializer):
start_date_written = serializers.DateField()
end_date_written = serializers.DateField()
relation_type = serializers.SerializerMethodField(method_name="add_relation_label")
revisions = serializers.SerializerMethodField(method_name="add_revisions")

def add_revisions(self, obj):
ver = Version.objects.get_for_object(obj)
res = []
for v in ver:
usr_1 = getattr(v.revision, "user", None)
if usr_1 is not None:
usr_1 = usr_1.username
else:
usr_1 = "Not specified"
res.append(
{
"id": v.id,
"date_created": v.revision.date_created,
"user_created": usr_1,
}
)
return res

def add_entity(self, obj):
return EntitySerializer(
Expand Down
4 changes: 0 additions & 4 deletions apis_core/apis_metainfo/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import reversion
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.contenttypes.models import ContentType
Expand All @@ -19,7 +18,6 @@
NEXT_PREV = getattr(settings, "APIS_NEXT_PREV", True)


@reversion.register()
class RootObject(GenericModel, models.Model):
"""
The very root thing that can exist in a given ontology. Several classes inherit from it.
Expand Down Expand Up @@ -80,7 +78,6 @@ def duplicate(self):
duplicate.alters_data = True


@reversion.register()
class Collection(GenericModel, models.Model):
"""Allows to group entities and relation."""

Expand Down Expand Up @@ -138,7 +135,6 @@ def get_queryset(self):
return UriQuerySet(self.model)


@reversion.register()
class Uri(GenericModel, models.Model):
uri = models.URLField(blank=True, null=True, unique=True, max_length=255)
domain = models.CharField(max_length=255, blank=True)
Expand Down

0 comments on commit 4da4a08

Please sign in to comment.