Hi all,
Actually I cannot move the pictures table declaration because both off them have references to each other (mutual reference?) In route the field photo_id references pictures and in pictures the field route_id references route.

--
 Paolo

Il 14.06.2012 09:56 Niphlod ha scritto:
don't know precisely how dal works, but if a table have a field
referenced in a table defined after that, wouldn't that cause a
problem ?

i.e. db.define_table('route',
Field('photo_id', 'reference pictures', readable=False,
writable=False)
)
db.define_table('pictures',
Field('name'))

does not work, where
db.define_table('pictures',
 Field('name'))
 db.define_table('route',
 Field('photo_id', 'reference pictures', readable=False,
 writable=False)
 )

instead works ?

Not using web2py, for normal sql development, you have to create
"child" tables before declaring a "parent" with references to it.

Reply via email to