You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found an issue with a model containing a one to one field that's also the primary key (ie the object should have the same primary key as the one it's related to).
class Foo(TimeStampedModel):
history = HistoricalRecords()
farf = models.OneToOneField(Farf, primary_key=True)
When running make migrations, I get this issue:
File ".../simple_history/models.py", line 291, in do_related_class
field = self.get_field(other, cls)
File "..../simple_history/models.py", line 256, in get_field
field = self.get_one_to_one_field(to_field, other)
File ".../simple_history/models.py", line 241, in get_one_to_one_field
temp_field = self.__class__(to_field.rel.to._meta.object_name)
AttributeError: 'unicode' object has no attribute '_meta'
Note that the primary key I am using in object Farf is a UUIDField, which I guess is why it's appearing as 'unicode', although I am using the postgres version of this field. It's quite possible that it's some special case of using a field like this. I haven't tried it with a standard integer field. Am using Django 1.7.7 and PostgreSQLUUIDField from django extensions as the primary key in object Farf.
The text was updated successfully, but these errors were encountered:
I've found an issue with a model containing a one to one field that's also the primary key (ie the object should have the same primary key as the one it's related to).
When running make migrations, I get this issue:
Note that the primary key I am using in object Farf is a UUIDField, which I guess is why it's appearing as 'unicode', although I am using the postgres version of this field. It's quite possible that it's some special case of using a field like this. I haven't tried it with a standard integer field. Am using Django 1.7.7 and PostgreSQLUUIDField from django extensions as the primary key in object Farf.
The text was updated successfully, but these errors were encountered: