#31610: Make it easier to override the RelatedFieldWidgetWrapper in admin
------------------------------------------------+------------------------
               Reporter:  rm_                   |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  contrib.admin         |        Version:  master
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 My use case is to pass some initial data to new model instances added via
 the add-related link. This should be trivial leveraging
 ''ModelAdmin.get_changeform_initial_data'' but I can't find an easy way to
 pass the query string to the ''RelatedFieldWidgetWrapper'' widget in order
 to be rendered in the template.

 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.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/046.a8ef9be7693f938526c2ce8860c9e0a8%40djangoproject.com.

Reply via email to