Opened 9 years ago

Closed 8 years ago

#13720 closed (duplicate)

response_change does not consider _popup=1 when saving

Reported by: Donato Grieco Owned by: nobody
Component: contrib.admin Version: 1.2
Severity: Keywords: popup response_add response_change dismiss dismissAddAnotherPopup
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Using Admin interface, after adding a foreign key in popup (with the green plus next to the selectbox), the window is closed and the new value is inserted into the selectbox: this is done by calling "opener.dismissAddAnotherPopup" in the response page (see "admin/options/response_add") when "_popup=1" is in the url.

This does not work when 'changing' a foreign key in popup, because "admin/options/response_change" ignores the "_popup" parameter when saving.

I propose to clone "response_add" behaviour in "response_change" so that a "opener.dismissChangePopup" is called when changing a foreing key in popup.

Change History (4)

comment:1 Changed 8 years ago by Joni

I can't reproduce your problem, or maybe didn't understand it. When clicking on the green plus button next to the selectbox you are always creating a new record, not modifying.

I'm testing the following code (app name is ticket13720):

from django.db import models

class Animal(models.Model):
	name = models.CharField(max_length=255)
	type = models.ForeignKey('Type')
	def __unicode__(self):
class Type(models.Model):
	name = models.CharField(max_length=255)
	likes_to_eat = models.ForeignKey('Food')
	def __unicode__(self):
class Food(models.Model):
	name = models.CharField(max_length=255)
	def __unicode__(self):

from django.contrib import admin

from ticket13720.models import Animal, Type, Food

comment:2 Changed 8 years ago by Donato Grieco

Thank you for your reply and excuse me for my rough english!
I forgot to say that I'm trying to use the features of admin interface in my own project. In my interface it is possible to open a foreign key in popup in order to change its fields. I noticed that this is not possible with current admin features, but just a few changes in "response_add" would make it.
So, this is not a lack in admin behaviour, but these changes would increase admin usability as an API.

comment:3 Changed 8 years ago by Joni

Triage Stage: UnreviewedDesign decision needed

comment:4 Changed 8 years ago by rasca

Resolution: duplicate
Status: newclosed

Based on donatook last comment closed as a duplicate of #13165

Note: See TracTickets for help on using tickets.
Back to Top