On Wednesday, November 21, 2012 12:38:36 AM UTC+5:30, SamD wrote:
> Would'nt it be more convenient to force whatever is passed to behave as a
> list (of strings) ?
Came across response from Massimo about this here :
https://groups.google.com/d/msg/web2py/Je-joYm3ob4/yrhE5r09vI4J
TL:DR : Yes
I suppose so. You could just take an empty list, append request.vars.mylist
to it, and then it should definitely be a list.
On Tuesday, November 20, 2012 12:08:36 PM UTC-7, SamD wrote:
>
> Thanks, I found those fixes useful. At the same time, it is quite a pain
> to have a message of error sayin
Thanks, I found those fixes useful. At the same time, it is quite a pain to
have a message of error saying the type is not correct just because the
list we pass contains only one element or no element. Would'nt it be more
convenient to force whatever is passed to behave as a list (of strings) ?
>>> l = 'bla'
>>> if type(l)==str:
... l=[l]
...
>>> type(l)
>>>
On Friday, March 30, 2012 6:36:01 AM UTC-4, weheh wrote:
>
> I have a grouping function based on what items are selected in a
> multi-select widget. When the user presses a button, an ajax call is made
> to a callback that ev
I'd say the most efficient is:
if type(mylist).__name__='string':
else
etc etc..
On Friday, March 30, 2012 3:36:01 AM UTC-7, weheh wrote:
>
> I have a grouping function based on what items are selected in a
> multi-select widget. When the user presses a button, an ajax call is made
> to a callb
5 matches
Mail list logo