Opened 8 years ago

Closed 7 years ago

Last modified 5 years ago

#9784 closed (fixed)

Django admin: prepopulated_fields does not update on javascript (calendar) change

Reported by: x00nix@… Owned by: David Gouldin
Component: contrib.admin Version: 1.0
Severity: Keywords:
Cc: dgouldin@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I have prepopulated_fields = {'slug':('publication_date',) }, where publication_date is models.DateField.

In admin when I change date via javascript calendar, slug field is not updated. If I change it directly, slug field is updated correctly.

Attachments (2)

9784.diff (8.7 KB) - added by David Gouldin 8 years ago.
9784.2.diff (6.0 KB) - added by David Gouldin 8 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 8 years ago by Jacob

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:2 Changed 8 years ago by David Gouldin

Cc: dgouldin@… added
Has patch: set

comment:3 Changed 8 years ago by Jacob

Triage Stage: AcceptedReady for checkin

comment:4 Changed 8 years ago by David Gouldin

Owner: changed from nobody to David Gouldin
Patch needs improvement: set

Need to add support for prepopulated field based on DateTime and hook events on "Today" and "Now" shortcuts.

comment:5 Changed 8 years ago by Jacob

Triage Stage: Ready for checkinAccepted

Kick back to accepted.

Changed 8 years ago by David Gouldin

Attachment: 9784.diff added

comment:6 Changed 8 years ago by David Gouldin

Patch needs improvement: unset

Added prepopulate support for MultiWidgets and hooked events for date and time shortcuts.

comment:7 Changed 8 years ago by David Gouldin

Patch needs improvement: set

Revising my approach ...

Changed 8 years ago by David Gouldin

Attachment: 9784.2.diff added

comment:8 Changed 8 years ago by David Gouldin

Patch needs improvement: unset

comment:9 Changed 8 years ago by Jacob

milestone: 1.11.2

Pushing to 1.2: this is an annoying bug, but it's UI only and has an easy workaround of writing the slug by hand.

comment:10 Changed 7 years ago by James Bennett

milestone: 1.21.3

I'm going to bump this off the 1.2 milestone, for a couple reasons:

  1. There are several tickets (this one, #9110, #9264 and #9983) all exposing cases where the event handling for prepopulated_fields falls over in specific edge cases, so the real solution is not to fix any of these individually but rather to make prepopulate_from more robust.
  2. I suspect the admin-ui work will be coming up for discussion in the 1.3 timeframe, and that's a more solid place to talk about dealing with this.

comment:11 Changed 7 years ago by Luke Plant

Resolution: fixed
Status: newclosed

(In [12937]) Fixed #13068, #9264, #9983, #9784 - regression with pre-populated fields and javascript inlines, and related bugs.

Thanks to hejsan for the report, and to Sean Brant and Carl Meyer for the patch.

#13068 is a regression caused by the new javascript inline forms in the
admin. The others were existing javascript bugs with prepopulated fields.
Since the solution depends on jQuery and would likely be very hard to
backport without it, it will not be backported to 1.1.X.

comment:12 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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