Code

Opened 4 years ago

Closed 3 years ago

#13086 closed Uncategorized (wontfix)

Field.get_choices() shouldn't add blank_choice if there is an equivalent in self.choices

Reported by: skoom Owned by: nobody
Component: Forms Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This will allow someone to override the blank choice (e.g. BLANK_CHOICE_DASH) easily by having (,'Custom Value') in their list of choices

Attachments (1)

choices.diff (648 bytes) - added by skoom 4 years ago.
diff patch

Download all attachments as: .zip

Change History (7)

comment:1 Changed 4 years ago by skoom

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Formatting changed the description, sorry,

I mean ("","Custom Value")

Changed 4 years ago by skoom

diff patch

comment:2 Changed 4 years ago by skoom

  • Has patch set

comment:3 follow-up: Changed 4 years ago by russellm

  • Needs tests set
  • Resolution set to wontfix
  • Status changed from new to closed
  • Triage Stage changed from Unreviewed to Accepted

Marking wontfix because there are already ways to do this; we don't need another.

comment:4 in reply to: ↑ 3 Changed 4 years ago by skoom

Replying to russellm:

Marking wontfix because there are already ways to do this; we don't need another.

How can I do it? I have 14 (two for each day) TimeField with 24 (hourly) choices and one blank choice I want to be 'Not Available'

Is there an easy way to do this without having to redefine all 14 fields in the ModelForm?

comment:5 Changed 3 years ago by theaspect@…

  • Component changed from Core (Other) to Forms
  • Easy pickings unset
  • Resolution wontfix deleted
  • Severity set to Normal
  • Status changed from closed to reopened
  • Triage Stage changed from Accepted to Design decision needed
  • Type set to Uncategorized
  • UI/UX unset
  • Version changed from SVN to 1.3

I've reopened this ticket with "design decision needed" because today aren't easy way to define blank_choice for ChoiceField, TypedChoiceField other than overriding choicefield or patching fields in init

related thread:
http://groups.google.com/group/django-users/browse_thread/thread/f40d160714346979

russellm closed ticked but didn't suggest any simple way.

comment:6 Changed 3 years ago by PaulM

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

And I'm re-closing it because you didn't follow proper procedure. Bring it up on the django-dev mailing list if you think it is really a problem, don't re-open a ticket closed by a core dev without permission.

Last edited 3 years ago by PaulM (previous) (diff)

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.