My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 48: TreeNodeChoiceField should allow non-selection
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  jonathan.buchanan
Closed:  Jul 2009


 
Reported by sime...@gmail.com, Feb 26, 2009
Due to the line: 

kwargs['empty_label'] = None

a TreeNodeChoiceField (even with required = False) won't display an empty
top value in the select control to allow a non-selection... Modifying it to
allow user-override is trivial and allows me to use the control for when I
want to (optionally) insert things into a tree or leave unordered in the
admin...

See attached diff for following code in forms.py - 

if 'empty_label' not in kwargs:
  kwargs['empty_label'] = None
mptt.diff
550 bytes   View   Download
Mar 12, 2009
#1 pan.piel...@gmail.com
Merging this would save a lot of useless subclassing :)
Jul 1, 2009
Project Member #2 jonathan.buchanan
(No comment was entered for this change.)
Status: Accepted
Jul 1, 2009
Project Member #3 jonathan.buchanan
Hmm, that was a bit silly.

As of r120 and r121 TreeNodeChoiceField no longer wipes out empty_label if the field
is not required or if an empty_label was provided.
Status: Fixed
Owner: jonathan.buchanan

Powered by Google Project Hosting