Tuesday, October 27, 2015

Re: Django admin add related object doesn't open popup window?

Thanks, I succesfully disabled the add button, as a temporary patch.

Any ideas of why the popup isn't working?


On Saturday, October 24, 2015 at 2:57:23 AM UTC-4, Derek wrote:
Disable the popup ... a suggestion was made in  https://code.djangoproject.com/ticket/9071 which is:

class ProductAdmin(ModelAdmin):

    def get_form(self, request, obj=None, **kwargs):
        """
        Don't allow adding new Product Categories
        """
        form = super(ProductAdmin, self).get_form(request, obj, **kwargs)
        form.base_fields['category'].widget.can_add_related = False
        return form


On Thursday, 22 October 2015 16:48:14 UTC+2, j.coss...@gmail.com wrote:

I already posted this question on Stackoverflow (http://stackoverflow.com/q/33189728/855050), but haven't received any answers, just a comment by another user with the same issue. I am posting here for added visibility. I think this is a bug in Django v1.8. I'll copy the question's text here for convenience.


The django-admin app is supposed to open a popup window when I try to create a related object. For example, clicking the green plus button here:






Should bring a new pop-up window, where I can create a new related (in this case Session) object. However, when I click the green plus button, the object create opens up in the same window, instead of a pop-up window. This is a problem, because if a user starts to create a primary object, then half-way through, clicks the green plus, he will lose all the progress on the primary object. This means that the green plus is unusable.

I have no idea why this is happening. Any ideas of how I can diagnose this? And fix it?



Related: http://stackoverflow.com/q/29811544/855050. But he's using Grappelli, which I am not. I am using the default django admin interface.

I am using Django version 1.8.

PD: In the meantime, is there a way to disable the popups? Right now this feature is broken in my server and its affecting my users.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2bc69532-d4e7-4b66-96b2-b921539d8d2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment