#26387: Related popup doesn’t open in a changelist when list_editable in
raw_id_fields
---------------------------------+------------------------------------
     Reporter:  BertrandBordage  |                    Owner:  nobody
         Type:  Bug              |                   Status:  new
    Component:  contrib.admin    |                  Version:  1.8
     Severity:  Release blocker  |               Resolution:
     Keywords:                   |             Triage Stage:  Accepted
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+------------------------------------
Changes (by timgraham):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * severity:  Normal => Release blocker
 * version:  1.9 => 1.8
 * needs_docs:   => 0
 * stage:  Unreviewed => Accepted


Old description:

> Suppose you have this admin class, where 'fk' is a ForeignKey field name:
> {{{#!python
> @register(YourModel)
> class YourModelAdmin(ModelAdmin):
>     list_display = ['fk']
>     list_editable = ['fk']
>     raw_id_fields = ['fk']
> }}}
> When you open the changelist, everything is displayed normally, fk
> consists in a field and a magnifying glass. But no javascript 'click'
> event is bound to the glass, so the changelist of the related model opens
> directly in the main window, not in popup.
>
> Of course, it prevents the users from filling the field, the only
> solutions being: to type the ID, or to open the change view, which may be
> disabled if you want users to only use the changelist…
>
> Bug experienced on all Django 1.9 versions, and probably master.

New description:

 Suppose you have this admin class, where 'fk' is a ForeignKey field name:
 {{{#!python
 @register(YourModel)
 class YourModelAdmin(ModelAdmin):
     list_display = ['pk', 'fk']
     list_editable = ['fk']
     raw_id_fields = ['fk']
 }}}
 When you open the changelist, everything is displayed normally, fk
 consists in a field and a magnifying glass. But no javascript 'click'
 event is bound to the glass, so the changelist of the related model opens
 directly in the main window, not in popup.

 Of course, it prevents the users from filling the field, the only
 solutions being: to type the ID, or to open the change view, which may be
 disabled if you want users to only use the changelist…

 Bug experienced on all Django 1.9 versions, and probably master.

--

Comment:

 I found it necessary to include another field in `list_display` to
 reproduce this. Otherwise on master, you'll get an error like `"The value
 of 'list_editable[0]' refers to the first field in 'list_display'
 ('question'), which cannot be used unless 'list_display_links' is set."` I
 edited the ticket description to include this.

 Seems to be a regression in Django 1.8 the popup works on 1.7.

--
Ticket URL: <https://code.djangoproject.com/ticket/26387#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/073.d9a5ed03e41e2e9d4d48160000b53d51%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to