Skip to content

Commit

Permalink
small whitespace tweaks and comments, fixes #58
Browse files Browse the repository at this point in the history
  • Loading branch information
LegoStormtroopr committed Feb 1, 2016
1 parent 0a9b465 commit 931b3f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<pre class="highlight">
<del>- {{ bool1 }}</del>
<ins>+ {{ bool2 }}</ins>
</pre>
</pre>

0 comments on commit 931b3f5

Please sign in to comment.