diff --git a/djangoldp/models.py b/djangoldp/models.py index 7ab277f0bb5083e246067cf2f62392a66912bc0c..ee4ebe72b4a8f759518654a818ec2340f6d047a1 100644 --- a/djangoldp/models.py +++ b/djangoldp/models.py @@ -65,7 +65,7 @@ class Model(models.Model): class Meta: default_permissions = ('add', 'change', 'delete', 'view', 'control') abstract = True - depth = 1 + depth = 0 @classonlymethod def resolve_id(cls, id): diff --git a/djangoldp/serializers.py b/djangoldp/serializers.py index 4f806051b487b80df977cc50d867be5801f2638f..620516c057cb45c55be6a2396fd4bf3401eb27b5 100644 --- a/djangoldp/serializers.py +++ b/djangoldp/serializers.py @@ -238,8 +238,6 @@ class LDPSerializer(HyperlinkedModelSerializer): return data def build_field(self, field_name, info, model_class, nested_depth): - nested_depth = self.compute_depth(nested_depth, model_class) - return super().build_field(field_name, info, model_class, nested_depth) def build_property_field(self, field_name, model_class): @@ -318,7 +316,6 @@ class LDPSerializer(HyperlinkedModelSerializer): return type(field_class.__name__ + 'Valued', (JSonLDStandardField, field_class), {}), field_kwargs def build_nested_field(self, field_name, relation_info, nested_depth): - nested_depth = self.compute_depth(nested_depth, self.Meta.model) class NestedLDPSerializer(self.__class__): @@ -390,23 +387,10 @@ class LDPSerializer(HyperlinkedModelSerializer): kwargs['required'] = False return NestedLDPSerializer, kwargs - @classmethod - def compute_depth(cls, depth, model_class, name='depth'): - try: - model_depth = getattr(model_class._meta, 'depth', getattr(model_class.Meta, 'depth', 10)) - depth = min(depth, int(model_depth)) - except AttributeError: - depth = min(depth, int(getattr(model_class._meta, 'depth', 1))) - - return depth @classmethod def many_init(cls, *args, **kwargs): kwargs['child'] = cls(**kwargs) - try: - cls.Meta.depth = cls.compute_depth(kwargs['context']['view'].depth, cls.Meta.model, 'depth') - except KeyError: - pass return ContainerSerializer(*args, **kwargs) def get_value(self, dictionary): diff --git a/djangoldp/tests/runner.py b/djangoldp/tests/runner.py index 230740f0dba6112096b801764f661d46a2d675f9..296716a1aeb175693462c90389eaa903b5905796 100644 --- a/djangoldp/tests/runner.py +++ b/djangoldp/tests/runner.py @@ -63,7 +63,7 @@ failures = test_runner.run_tests([ 'djangoldp.tests.tests_auto_author', 'djangoldp.tests.tests_get', 'djangoldp.tests.tests_delete', - 'djangoldp.tests.tests_temp' + # 'djangoldp.tests.tests_temp' ]) if failures: diff --git a/djangoldp/tests/tests_temp.py b/djangoldp/tests/tests_temp.py index e7a80ca51919425c49f72202bab53c1ab76835a8..1864f386b785ba0ca266a74422bd152cb91c1533 100644 --- a/djangoldp/tests/tests_temp.py +++ b/djangoldp/tests/tests_temp.py @@ -18,4 +18,3 @@ class TestTemp(TestCase): pass -