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 admin widget for fk fields #662

Merged
merged 5 commits into from
Nov 22, 2022

Conversation

Hafnernuss
Copy link
Contributor

This PR resolves #660 by adding a check if the target field is a relation.
The underyling cause has already been explained, but in short:
Related fields are wrapped for the admin representation. For example, a ForeignKey isn't simply a django SelectWidget, but a RelatedFieldWidgetWrapper. The original code added the mt css classes to the wrapper class instead of the real widget, causing the tabbing to fail.

Added makeshift tests, which simply make sure that the mt classes are attached to the correct widget.

@Hafnernuss Hafnernuss changed the title Fix admin relatedFix admin widget for fk fields Fix admin widget for fk fields Nov 14, 2022
@last-partizan last-partizan merged commit fcfbd5c into deschler:master Nov 22, 2022
@Hafnernuss Hafnernuss deleted the fix-admin-related branch November 28, 2022 09:46
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.

TabbedUI not working for ForeignKeys
2 participants