On Jun 9, 10:56 am, pk <peter.kirch...@youngdesigners.de> wrote:
> I´ve a table called project and i have another table called
> projectfile. How can i reference automaticlly the project.id in the
> table projectfile?
> db.define_table('projectfile',
>                 SQLField('projectid', default=project.id,
> writable=False, readable=False),

SQLField('projectid', db.project, writable=False, readable=False)

To populate the default you'll need to use a crud.create.onvalidation
callback.
(The model definition has no idea which project you're referring to.

F
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to