diff --git a/polymorphic/base.py b/polymorphic/base.py index b1f40253..edae2f0d 100644 --- a/polymorphic/base.py +++ b/polymorphic/base.py @@ -73,7 +73,7 @@ def __new__(self, model_name, bases, attrs, **kwargs): # determine the name of the primary key field and store it into the class variable # polymorphic_primary_key_name (it is needed by query.py) for f in new_class._meta.fields: - if f.primary_key and type(f) != models.OneToOneField: + if f.primary_key: new_class.polymorphic_primary_key_name = f.name break