Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#13407 closed (fixed)

admin "add another" inline JS fails for M2M inlines

Reported by: carljm Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: jquery
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The generated "id" attributes contain a spurious "+" right after the model name, which seems to prevent jQuery from selecting by that id.

This is with an auto-generated through model (using "model = Something.relation.through" in the InlineModelAdmin). Haven't yet tested with real m2m through models, but I'm guessing that would make the problem go away, as it's then just like a normal FK.

I'll add a test case soon.

Change History (3)

comment:1 Changed 6 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

For anyone chasing this: The spurious "+" is an exposure of an internal; Django uses a "+" suffix to hide autogenerated related_name attributes.

comment:2 Changed 6 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(In [13029]) Fixed #13407 -- Corrected verbose names for autogenerated m2m models, and cleaned up the default form prefix when an autogenerated m2m through model is used in a formset. Thanks to carljm for the report.

comment:3 Changed 5 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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