Skip to content

Commit fce7720

Browse files
committed
Support Django 1.4's slightly different to_field processing
1 parent db33ccb commit fce7720

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

simple_history/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ def copy_fields(self, model):
146146
field_arguments['db_constraint'] = False
147147
if getattr(old_field, 'to_fields', []):
148148
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
149151
field = FieldType(
150152
old_field.rel.to,
151153
related_name='+',

0 commit comments

Comments
 (0)