Re: Allowing single values instead of tuples for choices in ChoiceField

2009-08-09 Thread Malcolm Tredinnick
On Sun, 2009-08-09 at 00:41 -0700, andybak wrote: > It does get slightly uglier when you have cases such as: > f = CharField(choices=zip > (some_complex_expression_that_generates_a_list, > some_complex_expression_that_generates_a_list)) > > You don't really want to assign the expression to a vari

Re: Allowing single values instead of tuples for choices in ChoiceField

2009-08-09 Thread Daniel Roseman
On Aug 9, 8:41 am, andybak wrote: > It does get slightly uglier when you have cases such as: > f = CharField(choices=zip > (some_complex_expression_that_generates_a_list, > some_complex_expression_that_generates_a_list)) > > You don't really want to assign the expression to a variable within > yo

Re: Allowing single values instead of tuples for choices in ChoiceField

2009-08-09 Thread andybak
It does get slightly uglier when you have cases such as: f = CharField(choices=zip (some_complex_expression_that_generates_a_list, some_complex_expression_that_generates_a_list)) You don't really want to assign the expression to a variable within your model and if you put it elsewhere then it hur

Re: Allowing single values instead of tuples for choices in ChoiceField

2009-08-08 Thread Filip Gruszczyński
> In any case, I'm with Jacob and Russell on being a strong -1 here. It's > a dozen extra characters of very standard Python if you want to do this > in your own code. Not worth adding to Django's core, along with all the > accompanying documentation and regression testing and maintenance. OK, th

Re: Allowing single values instead of tuples for choices in ChoiceField

2009-08-07 Thread Malcolm Tredinnick
On Fri, 2009-08-07 at 08:37 -0700, gruszczy wrote: > Hi everyone! > > I have created a ticket here: http://code.djangoproject.com/ticket/11644, > but it was marked wontfix and told to ask here about this change. > > The issue is that I consider convenient being able to pass a list of > either tu

Re: Allowing single values instead of tuples for choices in ChoiceField

2009-08-07 Thread Jacob Kaplan-Moss
On Fri, Aug 7, 2009 at 10:37 AM, gruszczy wrote: > The issue is that I consider convenient being able to pass a list of > either tuples or single objects for choices list in forms ChoiceField. > The engine would itself detect non-tuple values and turn them into two- > tuples. There are some good p

Allowing single values instead of tuples for choices in ChoiceField

2009-08-07 Thread gruszczy
Hi everyone! I have created a ticket here: http://code.djangoproject.com/ticket/11644, but it was marked wontfix and told to ask here about this change. The issue is that I consider convenient being able to pass a list of either tuples or single objects for choices list in forms ChoiceField. The