Each steps from table project_type_step should be copied to table
project_step, after creating a new project through the form.
Am Dienstag, 10. September 2013 11:16:33 UTC+2 schrieb Luc Chase:
>
> You want to copy all the steps... then mark each as it is done? Or are you
> wanting to create each done project_step record only after it is done?
>
>
>
> On Tuesday, 10 September 2013 00:02:40 UTC+1, Andreas Wienes wrote:
>>
>> Thanks for your advice! I corrected the small error and created the new
>> table. Now I'm trying to copy the steps for a specific project_type to a
>> new created project.
>>
>> I tried the following:
>>
>> def start():
>> form = SQLFORM(db.project).process()
>> if form.accepted:
>> project_type = form.vars.project_type
>> for row in db(db.step.project_type_id==project_type).select():
>> # copy each step to the project_step table
>>
>> redirect(URL('index', args=form.vars.project_type))
>> return locals()
>>
>> But I don't know how to copy from one table to another. Any ideas?
>>
>>
--
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/groups/opt_out.