-
Notifications
You must be signed in to change notification settings - Fork 248
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
Add another popup doesn't add ?_popup=1
to url in Django 1.8
#118
Comments
That must be why it doesnt close itself and set the pk correctly. I noticed There are unit tests now so I hope to corner these annoying breakages and
|
I think the problem might be around detecting when an object is selected - I get the popup working fine, but when add_popup in the views tries to inspect the response text to look for dismissAddAnotherPopup it doesn't find it - admin.add_view is returning a redirect response because it no longer has the _popup query string value in it. I've got a bit of a dirty hack to resolve this which basically entails:
|
This change seems to fix the problems with this functionality, but it might be a bit of a dirty hack, rather than the actual solution you want to go with: But if you're happy to bring it in, let me know and I'll send over the pull request. |
Would be good to have Django 1.8 support. |
So where is django-ajax-selects now? I see a lot of commits but no new release with Django 1.8/Py3.X support. |
The development branch has full support and I'm working on the release today The previous release 1.3.6 supports Django 1.8 but with a deprec warning. Django 1.9 beta would not work, but it does work with the impending release. Python 3 has been supported for many versions but one commit broke that. Now the tox tests check all pythons up to 3.5 |
nice :) |
1.4.0 came out on Sunday. Sorry I forgot to announce here. Check the docs, they are I think much better. Configuration is easier than On Mon, Nov 2, 2015 at 10:52 AM Piotr Maliński notifications@github.com
|
Using the included example, when adding a
Song
object athttp://localhost:8000/admin/example/song/add/
, there is a field for selecting aGroup
foreign key with a "+ add" link next to it.In Django < 1.8, when clicking on the link, a popup opens with the url
http://localhost:8000/admin/lookups/add_popup/example/group?_popup=1
and when saving theGroup
, the popup closes and theGroup
field is populated in theSong
form.However in Django >= 1.8 the popup url is
http://localhost:8000/admin/lookups/add_popup/example/group
(note the missing?_popup=1
) and when saving theGroup
, the popup redirects to theGroup
and doesn't populate theSong
form'sGroup
field.Presumably some admin javascript changed in the Django 1.8 update, but I haven't yet tracked it down.EDIT: It looks like the
showAddAnotherPopup
/showRelatedObjectPopup
has changed and it no longer adds the _popup parameterThe text was updated successfully, but these errors were encountered: