Permalink
Browse files

Merge pull request #86 from berinhard/topic/cohesive-instance-check

Uses isinstance method to be more cohesive
  • Loading branch information...
2 parents 6b8f0b6 + 00b48fc commit 2d12b9dd9941655aece79ce756456f820498a502 @vandersonmota committed Mar 30, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 model_mommy/mommy.py
View
@@ -305,7 +305,7 @@ def generate_value(self, field, **fk_attrs):
generator = self.attr_mapping[field.name]
elif getattr(field, 'choices'):
generator = generators.gen_from_choices(field.choices)
- elif isinstance(field, ForeignKey) and field.rel.to is ContentType:
+ elif isinstance(field, ForeignKey) and isinstance(field.rel.to, ContentType):
generator = self.type_mapping[ContentType]
elif field.__class__ in self.type_mapping:
generator = self.type_mapping[field.__class__]

0 comments on commit 2d12b9d

Please sign in to comment.