Form = SQLFORM.factory(db.author,db.link,db.post)

if form.process().accepted:
   ...
return dict(form=form)
Em 05/11/2013 14:59, "Noah" <[email protected]> escreveu:

> I have a relational database structure containing 3 tables, set up in the
> model as follows:
>
> db.define_table('author',
>     Field('name', 'string'),
>     Field('bio', 'text'))
>
> db.define_table('link',
>     Field('name', 'string'),
>     Field('description', 'text'))
>
> db.define_table('post',
>     Field('body','text',label="Post Body"),
>     Field('authorID', db.author),
>     Field('linkID', db.link),
>     Field('posted_on','datetime',readable=False,writable=False),
>     Field('posted_by','reference auth_user',readable=False,writable=False))
>
> I want to create a form that allows the user to submit a Post using the
> following inputs:
>
>    - Post Body -(db.post.body)
>    - Author Name -(db.author.name)
>    - Link Name -(db.link.name)
>
> If the author name or link name already exists in the database, it doesn't
> need adding to that table again. Instead the post should just be inserted
> using the existing IDs.
>
> I'm way over my head on this one.. I'm just learning Web2Py.
> Thanks for any help!
>
> --
> 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.
>

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

Reply via email to