Code

Opened 6 years ago

Closed 4 years ago

#9110 closed (duplicate)

prepopulate_from only works for text entry fields

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

Description

With the current implementation, prepopulate_from only works when the fields being drawn from are basic textentry fields: it can't handle choice fields such as ForeignKeys, &c. The attached patch changes this so that if the field specified to prepopulate from is any sort of choice field it will use onchange instead of onkeyup to monitor the field, and will retrieve the text of the field to get the selected option rather than the value which would return the wrong thing.

Attachments (1)

prepopulated_fields_js.diff (1.6 KB) - added by josho 6 years ago.

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by josho

comment:1 Changed 5 years ago by jacob

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

comment:2 Changed 4 years ago by carljm

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

This is actually a straight-up duplicate of #9983.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.