Sorry for miss leading, Niphold is true...

So,

for f, v in request.vars.iteritmes():
     db.table[f].default = v


On Sat, May 3, 2014 at 8:47 AM, Niphlod <[email protected]> wrote:

> request.vars is like a dict. Surely you're hitting that issue :-P
>
> >>> test = dict(a=1,b=2)
> >>> for k,v in test:
> ...    print k, v
> ...
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ValueError: need more than 1 value to unpack
> >>>
>
> Add an "iteritems()" and you're good to go
>
> >>> for k,v in test.iteritems():
> ...     print k,v
> ...
> a 1
> b 2
>
> >>>
>
> On Friday, May 2, 2014 11:20:40 PM UTC+2, LoveWeb2py wrote:
>>
>> Web2py admin console has a red line at for f, v in request.vars: and then
>> says too many values to unpack.
>>
>> my function is def transition_form():
>>      for f, v in request.vars:
>>      db.table[f].default = v
>>  form = SQLFORM(db.table, user_signature=True)
>> return dict(form=form)
>>
>> Should I have extra values in the dict method?
>>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to