On Sep 27, 9:41 pm, yish <[EMAIL PROTECTED]> wrote:
> I defined my search_fields for my model as
>   seach_fields ('name')
> instead of
>   search_fields ['name']
> ...
> If anyone is curious, what ended up happening is instead of iterating
> across the search fields, it iterated across the letters in 'name' and
> the query_set barfed on the result of that.

Just as an FYI, that's a peculiarity of Python.  Single-element lists
do not require a trailing comma, but single-element tuples do.  See
http://docs.python.org/lib/typesseq.html

"Tuples are constructed by the comma operator (not within square
brackets), with or without enclosing parentheses, but an empty tuple
must have the enclosing parentheses, such as a, b, c or (). A single
item tuple must have a trailing comma, such as (d,)."

>>> 'test' == ('test')
True
>>> 'test' == ('test',)
False


Will.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to