Opened 7 years ago

Closed 5 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 7 years ago.
diff patch

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by skoom

Formatting changed the description, sorry,

I mean ("","Custom Value")

Changed 7 years ago by skoom

Attachment: choices.diff added

diff patch

comment:2 Changed 7 years ago by skoom

Has patch: set

comment:3 Changed 7 years ago by Russell Keith-Magee

Needs tests: set
Resolution: wontfix
Status: newclosed
Triage Stage: UnreviewedAccepted

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

comment:4 in reply to:  3 Changed 7 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 5 years ago by theaspect@…

Component: Core (Other)Forms
Easy pickings: unset
Resolution: wontfix
Severity: Normal
Status: closedreopened
Triage Stage: AcceptedDesign decision needed
Type: Uncategorized
UI/UX: unset
Version: SVN1.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 5 years ago by Paul McMillan

Resolution: wontfix
Status: reopenedclosed

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 5 years ago by Paul McMillan (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top