Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#15693 closed Bug (duplicate)

Support broken for custom widgets in inlines Jquery based Add new <model type>

Reported by: brillgen Owned by: nobody
Component: contrib.admin Version: 1.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX:

Description

If one of the fields in an inline has a custom widget which uses javascript, then the Add New <Model Name> jquery based JS function is unable to render the widget correctly even though the widget works and renders fine with existing inlines or with inlines which are created using the extra option in Admin

Change History (7)

comment:1 Changed 4 years ago by lukeplant

  • Type set to Bug

comment:2 Changed 4 years ago by lukeplant

  • Severity set to Normal

comment:3 Changed 4 years ago by julien

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to needsinfo
  • Status changed from new to closed

This report is a bit too vague. If you're experiencing an issue, please reopen and provide a more detailed use case, or even better some code we can test. Also, it'd be useful if you could track when (if) this actually got broken.

comment:4 Changed 4 years ago by brillgen

  • Easy pickings unset
  • Resolution needsinfo deleted
  • Status changed from closed to reopened

I'll work on extracting the code so that it can be presented here but I think the issue has been described pretty clearly to someone familiar with the Admin and/or its internals.

This got broken in Django 1.1/1.2 when the new functionality of adding inlines on-the-fly with javascript was introduced.

We have a custom widget we use to populate FK fields which works perfectly well with the Django Admin inlines when they have been created by the 'extra' parameter in the admin.
The widget does not work because its javascript event is not mapped to the new inline that has been created with javascript.

The bug is that the javascript add new inline functionality should support custom widgets as well...if it does, it's not obvious and not documented (AFAIK).

comment:5 follow-up: Changed 4 years ago by kmtracey

  • Resolution set to duplicate
  • Status changed from reopened to closed

Please see approach/patch proposed in #15760 addresses this issue for you. For now I'm marking this as a dupe of that which more clearly describes the issue.

comment:6 in reply to: ↑ 5 Changed 4 years ago by kmtracey

Sorry "Please see IF THE appraoch/patch..." is what I meant to write above.

comment:7 Changed 4 years ago by brillgen

Yes, I had that figured...that ticket does delve into the issue better technically...and yes, that approach should work...I am trying it out over the weekend and will update that ticket..Thanks for your help.

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