I want to create multiple forms with a 'for' statement and validate/process 
them.
the amount of forms to generate is dependent on a list containing user id's.
the list is dynamic; so I have a function generating a list, 'users', which 
contains: user:1L, user:4L, etc...
now I want to create a form for each of them and after 'submit' process 
them.

Normally I would just create a form in the controller like:
def show_form():
   form = SQLFORM.x()
   return dict(form=form)
and process it with:
   if form.accepts

however this would only generate one form... 
using:
def sow_form():
    for user in users:
        form = SQLFORM.x()
   return dict(form=form) 
and calling it from the view with {{=form}} doesn't work either because of 
'form' being static.

Creating the form from the view is a lot easier to do with:
{{for user in users:}}
(my form)
{{pass}}

but how do I process it?
I can give the form a unique name from the view with name="{{=user}}"
but then what?

The form is mostly prepopulated with vars created/calculated from the view 
but a part of those can be created/calculated from the controller. the form 
requires a uuid which needed in the processing of the form.

What is the best way to achieve this?
would:
def show_form():
    for user in users:
        form[user] = SQLFORM.x()
work? and how can I populate that form?

Please point me in the right direction.


-- 
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