Code

Opened 6 years ago

Closed 6 years ago

#6564 closed (duplicate)

USStateField - newforms - problems

Reported by: purdeaandrei Owned by: purdeaandrei
Component: Uncategorized Version: master
Severity: Keywords:
Cc: purdeaandrei@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: UI/UX:

Description

The problem appears with the newforms representation of USStateField.
There was absolutely no handling for the case when blank=True. (or with other words required=False).
These modification take the implementation closer to the implementation of ModelChoiceField (the one used for ForeignKey).

  • there is an empty_label parameter that is set to u'---------' by default
  • i removed the specialized widget, because no such widget was needed
  • modified the formfield method accordingly

This bug appears both in trunk and in the newforms-admin branch, the patch can safely be applyed to both.

Attachments (1)

usstate.diff (2.4 KB) - added by purdeaandrei 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by purdeaandrei

comment:1 Changed 6 years ago by anonymous

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

the diff i uploaded does not work well. it breaks regression tests, and it removes the us of USStateField formfield. - It is supposed to be used with text input, and not a select input! A separate class will be needed for the default choice input...

i am working on a new patch....
Purdea Andrei

comment:2 Changed 6 years ago by anonymous

  • Needs tests set
  • Patch needs improvement set

comment:3 Changed 6 years ago by purdeaandrei

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

sorry, duplicate of #4092

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.