From d23909df89df01b4b492cb03d449cda0061bc6da Mon Sep 17 00:00:00 2001 From: Manuel Jeckelmann Date: Fri, 19 Sep 2014 11:58:39 +0200 Subject: [PATCH] Fixed a small bug occurring in some special cases, mainly due to incorrect overwriting of RelatedObjectsDescriptors by Django --- setup.py | 2 +- versions/models.py | 4 ++-- versions/tests.py | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index fcc05b4..00cc5ec 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ """ setup(name='CleanerVersion', - version='1.2.1', + version='1.2.2', description='A versioning solution for relational data models', long_description='CleanerVersion is a solution that allows you to read and write multiple versions of an entry ' 'to and from your relational database. It allows to keep track of modifications on an object ' diff --git a/versions/models.py b/versions/models.py index bc3e913..d8acdca 100644 --- a/versions/models.py +++ b/versions/models.py @@ -674,7 +674,7 @@ class VersionedReverseManyRelatedObjectsDescriptor(ReverseManyRelatedObjectsDesc 'related_manager_cls' property """ - def __get__(self, instance, owner): + def __get__(self, instance, owner=None): """ Reads the property as which this object is figuring; mainly used for debugging purposes :param instance: The instance on which the getter was called @@ -704,7 +704,7 @@ def __init__(self, related, via_field_name): super(VersionedManyRelatedObjectsDescriptor, self).__init__(related) self.via_field_name = via_field_name - def __get__(self, instance, owner): + def __get__(self, instance, owner=None): """ Reads the property as which this object is figuring; mainly used for debugging purposes :param instance: The instance on which the getter was called diff --git a/versions/tests.py b/versions/tests.py index 5dc6974..0b92d5a 100644 --- a/versions/tests.py +++ b/versions/tests.py @@ -1229,5 +1229,3 @@ def test_filtering_two_jumps_reverse_with_version_at_t2(self): count = C3.objects.as_of(self.t2) \ .filter(c2s__c1s__name__startswith='c1').propagate_querytime().all().count() self.assertEqual(2, count) - -