diff --git a/apis_core/apis_entities/serializers_generic.py b/apis_core/apis_entities/serializers_generic.py index b3eae5019..94e94a670 100644 --- a/apis_core/apis_entities/serializers_generic.py +++ b/apis_core/apis_entities/serializers_generic.py @@ -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") @@ -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 = {} @@ -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( diff --git a/apis_core/apis_metainfo/models.py b/apis_core/apis_metainfo/models.py index 39ed4d441..ea1ed7ef0 100644 --- a/apis_core/apis_metainfo/models.py +++ b/apis_core/apis_metainfo/models.py @@ -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 @@ -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. @@ -80,7 +78,6 @@ def duplicate(self): duplicate.alters_data = True -@reversion.register() class Collection(GenericModel, models.Model): """Allows to group entities and relation.""" @@ -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)