Skip to content

Conversation

@guglielmo
Copy link
Contributor

@guglielmo guglielmo commented May 7, 2019

I've created this pull request to add compatibility with django 2.

It seems that adding the correct assets to the form by forms.Media is already available in django 1.7 (https://docs.djangoproject.com/en/1.7/topics/forms/media/#media-on-forms), so I guess the patch on the media property should be back-compatible. The nasty code there is needed in order to properly merge the assets, retaining the correct order, so that jquery is loaded and initialised before the dropdown javascript.

allow_tags was deprecated in django 1.10, and substituted with mark_safe, that's taken care of checking the VERSION variable in the pull request.

I had to comment the position() method in js/jquery.dropdown.js because it moved the dropdown selector to the top-left corner of the screen.
It works in my use case, but it's marked as todo.

Please, let me know if anything is needed to merge this into your repo.

@fruitschen fruitschen merged commit 8464354 into DjangoAdminHackers:master May 30, 2019
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