Opened 15 years ago

Closed 14 years ago

Last modified 13 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: no UI/UX: no

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 15 years ago.
9784.2.diff (6.0 KB ) - added by David Gouldin 15 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 by Jacob, 15 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:2 by David Gouldin, 15 years ago

Cc: dgouldin@… added
Has patch: set

comment:3 by Jacob, 15 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by David Gouldin, 15 years ago

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 by Jacob, 15 years ago

Triage Stage: Ready for checkinAccepted

Kick back to accepted.

by David Gouldin, 15 years ago

Attachment: 9784.diff added

comment:6 by David Gouldin, 15 years ago

Patch needs improvement: unset

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

comment:7 by David Gouldin, 15 years ago

Patch needs improvement: set

Revising my approach ...

by David Gouldin, 15 years ago

Attachment: 9784.2.diff added

comment:8 by David Gouldin, 15 years ago

Patch needs improvement: unset

comment:9 by Jacob, 15 years ago

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 by James Bennett, 14 years ago

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 by Luke Plant, 14 years ago

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 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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