Opened 17 years ago
Closed 16 years ago
#7133 closed (duplicate)
django admin: radio_admin is broken with addPopup and RelatedObjectLookups.js
Description ¶
It seems that radio_admin is broken in trunk's admin for adding new items through popup's.
django.contrib.redirects is an easy test case, create a project, put django.contrib.redirects in it and get the error when trying to add a new (with the plus symbol) record to the database and radio selection field.
Error message: (firebug)
SelectBox is not defined http://localhost:8000/media/js/admin/RelatedObjectLookups.js Line 73
After a little inspection of RelatedObjectLookups it seems to me that the entire javascript is not capable of handling radio_fields when adding new objects through the popup. The reason this error get's raised is because the javascript code handles it like it would be a combobox using the SelectBox javascript object instead of as a radio field. (The entire radio-field handling code is 'missing')
Since radio fields are no more in newforms-admin, it IMHO makes the most sense to remove the radio_admin option from the model in django.contrib.redirects (path attached)
Maybe also marking this option as deprecated in the documentation (http://www.djangoproject.com/documentation/model-api/) might be useful as it would disappear in nfa and seems to be currently broken (for a long time now? as i cannot find any revision that did handle adding items to the radio selection on page) for adding new items by popup in the admin pages.
Change History (5)
by , 17 years ago
Attachment: | 7133-remove-radio_admin-from-redirects-contrib.diff added |
---|
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Keywords: | nfa_someday added |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
Version: | SVN → newforms-admin |
Radio fields were no more in newform-admin just because they hadn't been implemented, not because they were intended to be removed. They are implemented now and this problem now exists in newforms-admin. While you can use the popup to add an item, the newly-added item doesn't show up in the radio list until you manually refresh the page. I have no idea how to fix this -- javascript is not something I've done much work with. Someone with more knowledge than I in this area needs to decide what to do about it, but at any rate since it was a problem in old admin it shouldn't block merge so marking nfa_someday.
comment:3 by , 16 years ago
As far as i can see this is not applicable anymore on post-Django 1.0
Recommend closing the ticket. (also added a patch to a new ticket, fixing/adding the dynamic additions of items to a radiolist in the admin: #10191 )
comment:4 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
I don't see why a new ticket was needed here -- the identified problem could as easily have been fixed under this ticket as a new one. You could have changed the summary, version, etc. to more accurately describe the current situation, if necessary. But, since you've created a new ticket and put the patch there, we can use that one. (You also could have closed this yourself -- no special privs are needed to close tickets.)
see http://code.djangoproject.com/ticket/5731 for newforms-admin branch