[web2py] Re: Defining db.py for the first time problem (db references possible?)

2010-06-16 Thread zsouthboy
> > db.define_table('image', >   Field('image', 'upload'), >   Field('owner', db.person)) > > db.person.image.requires=IS_EMPTY_OR(IS_IN_DB(db,'image.id')) > db.person.image.represent=lambda id: > A('link',_href=URL(r=r

[web2py] Re: Defining db.py for the first time problem (db references possible?)

2010-06-15 Thread zsouthboy
Hi Yarko, Thanks for the help! I had initially tried doing what the introductory docs show (which is marking a reference like ("image", db.image) for a column), which fails because there is no member 'image' of db yet. Then I consulted the technical docs and saw that instead "reference image" shou

[web2py] Defining db.py for the first time problem (db references possible?)

2010-06-14 Thread zsouthboy
Problem: I don't see how to specify multiple tables with table references to each other. I can't simply define the relationship, because the DAL hasn't created a table yet to reference. But I can't create the table(s) because they reference tables that also don't exist yet. Catch 22. Besides manual