Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility patch for Django 1.4 #2

Closed
wants to merge 2 commits into from

Conversation

jscheinblum
Copy link

I ran into trouble using the library with Django 1.4. I haven't been able to fully comprehend what broke, but the Choices, Polls example in the README was broken as seen in #Issue: #1

I'm not sure this is a complete patch, since I'm not sure what changed in 1.4 to cause the break (The release notes don't indicate a change in behavior, but the code is definitely different).

I'd be happy to clean this up if you can hint me where there are changes in internals of Django.

@treyhunner
Copy link
Member

Does this change work with Django 1.2 and 1.3 or is this backwards incompatible?

@@ -145,7 +145,10 @@ def create_historical_record(self, instance, type):
manager = getattr(instance, self.manager_name)
attrs = {}
for field in instance._meta.fields:
attrs[field.attname] = getattr(instance, field.attname)
if isinstance(field, models.ForeignKey):
attrs[field.name] = getattr(instance, field.attname)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should attname be name instead here?:

attrs[field.name] = getattr(instance, field.name)

@treyhunner treyhunner closed this Aug 29, 2012
macro1 pushed a commit that referenced this pull request Nov 7, 2017
barm pushed a commit to barm/django-simple-history that referenced this pull request Dec 9, 2018
# This is the 1st commit message:

Update admin.py

# The commit message jazzband#2 will be skipped:

# Update test_admin.py

# The commit message jazzband#3 will be skipped:

# Update test_admin.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants