Skip to content

Commit

Permalink
small whitespace tweaks and comments, fixes jedie#58
Browse files Browse the repository at this point in the history
  • Loading branch information
LegoStormtroopr committed Feb 1, 2016
1 parent fa085dc commit 2c88e47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions reversion_compare/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def get_reverse_foreign_key(self):
else:
ids = [v.id for v in getattr(obj, str(self.field.related_name)).all()] # is: version.field_dict[field.name]
if ids == [] and any([f.name.endswith('_ptr') for f in obj._meta.fields]):
# this object inherits from a non-abstract class, lets try and get the parent items associated entries
# If there is a _ptr this is a multiinheritance table and inherits from a non-abstract class
# lets try and get the parent items associated entries for this field
others = self.version.revision.version_set.filter(object_id=self.version.object_id)
for p in others:
p_obj = p.object_version.object
Expand Down Expand Up @@ -131,6 +132,7 @@ def get_many_to_many(self):
return self.get_many_to_something(ids, related_model)

def get_many_to_something(self, ids, related_model, is_reverse=False):

# get instance of reversion.models.Revision():
# A group of related object versions.
old_revision = self.version.revision
Expand Down Expand Up @@ -173,7 +175,6 @@ def get_many_to_something(self, ids, related_model, is_reverse=False):
true_missing_objects.append(o)
missing_objects = true_missing_objects
deleted = [d for d in reversion.get_deleted(related_model) if d.revision == old_revision]

return versions, missing_objects, missing_ids, deleted

def get_debug(self):
Expand Down

0 comments on commit 2c88e47

Please sign in to comment.