Thank You Masimo for answer,

Hm... so this is huge problem for me, because I have in dict many other 
options (I showed only one field to show the problem). Is there any easy 
way to append or insert Field (with corect select option generated in the 
view) to the form created by SQLFORM.dictform ? Or, to change the 
SQLFORM.dictform to SQLFORM.factory, but factory need to take dict with 
(many) fields ? I was very happy to see dictform - it perfectly fit into 
the config setter/updater for me, last thing I needed is to make select for 
some of the fields :(. 

Regards
brushek




W dniu niedziela, 5 stycznia 2014 17:07:09 UTC+1 użytkownik Massimo Di 
Pierro napisał:
>
> Unfortunately dictform does not support this. You can do:
>
> session.config = dict(NAME = 'a')
> form = 
> SQLFORM.factory(Field('NAME',default=session.config['NAME'],requires=IS_IN_SET(('a','b','c','d','e'),
>  
> error_message="Choose between a and e")))
>  if form.process().accepted: 
>         session.config['NAME'] = form.vars['NAME']
>
>
>
> On Saturday, 4 January 2014 11:26:10 UTC-6, brushek wrote:
>>
>> Hello :)
>>
>> I have following code in controller:
>>
>> session.config = dict(NAME = 'a')
>> form = SQLFORM.dictform(session.config)
>> form.custom.widget.NAME['requires'] = IS_IN_SET(('a','b','c','d','e'), 
>> error_message="Choose between a and e")
>>  if form.process().accepted: 
>>         session.config.update(form.vars)
>>
>> validator is working OK, but I would like to change the type of NAME 
>> field in form to select dropdown, instead simple input. How to do this ? 
>> How to change the type of field after it is created by any SQLFORM(.*)  ?
>>
>> Regards
>> brushek
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to