We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fce7720 commit 8b22681Copy full SHA for 8b22681
simple_history/models.py
@@ -146,8 +146,8 @@ def copy_fields(self, model):
146
field_arguments['db_constraint'] = False
147
if getattr(old_field, 'to_fields', []):
148
field_arguments['to_field'] = old_field.to_fields[0]
149
- elif django.get_version() == "1.4" and getattr(old_field, 'to_field', None):
150
- field_arguments['to_field'] = old_field.to_field
+ elif django.get_version() < "1.6" and old_field.rel.field_name != 'id':
+ field_arguments['to_field'] = old_field.rel.field_name
151
field = FieldType(
152
old_field.rel.to,
153
related_name='+',
0 commit comments