Possible plan:
- extract related field widget creation from
''BaseModelAdmin.formfield_for_dbfield'' into an
''get_widget_for_related_field'' helper
- create a ''get_url_params'' helper in ''RelatedFieldWidgetWrapper''
Both looks like cleanups that have their own merit.
--
Ticket URL: <https://code.djangoproject.com/ticket/31610>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
Comment:
WIP patch for discussion here https://github.com/django/django/pull/12937
--
Ticket URL: <https://code.djangoproject.com/ticket/31610#comment:1>
* status: new => closed
* resolution: => wontfix
Comment:
Thanks for this ticket, however you use case looks quite niche, I don't
see a wide use of new hooks. `raw_id_fields` should not be customized,
IMO. If you really need to use the same mechanism you can create a custom
widget (without using `raw_id_fields`).
--
Ticket URL: <https://code.djangoproject.com/ticket/31610#comment:2>
Comment (by rm_):
@felixxm I'm a bit puzzled. This is has nothing to do with
''raw_id_fields'' but with the changeform popup and the ''related widget''
wrapper :) I won't object the niche use case though but what I'm doing
here is making easier to override the default widget which is what you are
suggesting :)
--
Ticket URL: <https://code.djangoproject.com/ticket/31610#comment:3>
Comment (by felixxm):
True, sorry, forget what I said about `raw_id_fields`. Nevertheless I
still think you should be able to handle this with a custom widget.
--
Ticket URL: <https://code.djangoproject.com/ticket/31610#comment:4>
Comment (by rm_):
Sorr for the late response but I didn't get any notification. The plan is
to use a custom widget, the patches here are 1) a way to use a custom
widget without overriding the full BaseModelAdmin.formfield_for_dbfield
becasue RelatedFieldWidgetWrapper is hardcoded 2) extract a simpler
method in RelatedFieldWidgetWrapper to override (that also matches what
the other related widgets are doing). Anyway I don't want to insist,
thanks anyway for the review.
--
Ticket URL: <https://code.djangoproject.com/ticket/31610#comment:5>
* cc: rm_ (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/31610#comment:6>