Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
handle differences in previous version of django in how through model…
…s were represented
  • Loading branch information
paltman committed Sep 24, 2010
1 parent 18f3f70 commit 13ba82a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion milkman/dairy.py
Expand Up @@ -70,7 +70,11 @@ def is_m2m(self, field):
return field in [f.name for f in self.model_class._meta.local_many_to_many]

def has_explicit_through_table(self, field):
return not field.rel.through._meta.auto_created
if isinstance(field.rel.through, models.base.ModelBase): # Django 1.2
return not field.rel.through._meta.auto_created
if isinstance(field.rel.through, (str, unicode)): # Django 1.1
return True
return False

def set_explicit_values(self, target, explicit_values):
for k,v in explicit_values.iteritems():
Expand Down

0 comments on commit 13ba82a

Please sign in to comment.