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

Fix inline template Django 1.6b4 compatibility issue #157

Merged
merged 2 commits into from
Sep 30, 2013

Conversation

nliberg
Copy link
Contributor

@nliberg nliberg commented Sep 27, 2013

In the Django 1.6 beta, in django.contrib.admin.helpers.InlineAdminForm the function has_auto_field has been renamed to needs_explicit_pk_field. This causes the TabularInline and StackedInline to render incorrectly leading to a KeyDictError when saving records.

The error can be fixed by replacing has_auto_field with needs_explicit_pk_field in the templates: templates/admin/edit_inline/stacked.html and templates/admin/edit_inline/tabular.html

My modification is based on a solution by rhunwicks. For comparison see: django-admin-bootstrapped/django-admin-bootstrapped#58

@nliberg
Copy link
Contributor Author

nliberg commented Sep 27, 2013

I actually used an OR condition at first, but then changed it into two separate lines before I committed since that's how it was done in the bootstrapped commit (that commit differs from the linked discussion in this regard). Now I have joined the two if lines into one.

I am quite new to Github and a bit uncertain of what is considered best practices regarding revising pull requests (whether one is to add commits, or rewrite history in order to keep the log clean). I hope you can squash the second commit when you merge.

darklow added a commit that referenced this pull request Sep 30, 2013
Fix inline template Django 1.6b4 compatibility issue
@darklow darklow merged commit e823dad into darklow:develop Sep 30, 2013
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.

2 participants