Re: Dal Foreign keys

46 views
Skip to first unread message

Niphlod

unread,
Nov 30, 2012, 8:17:41 AM11/30/12
to web...@googlegroups.com
does the error show up if you use 'reference event_instance' instead of db.event_instance ?

('event_instance_id', 'reference event_instance')

Il giorno venerdì 30 novembre 2012 10:17:54 UTC+1, Samuel Komfi ha scritto:

I keep getting this error: 'DAL' object has no attribute 'event_instance'

it points to my db_agents file as the culprit on this line:

('event_instance_id', db.event_instance)

However if I move the definition of the event_instance table to that db_agents model file the error disappears, but I get a new one referering to another FKey in the event_instance tbl. Is there a way to avoid having all my db.define_tables in the same file, I would like to keep them separate

Anthony

unread,
Nov 30, 2012, 8:46:59 AM11/30/12
to web...@googlegroups.com
Also, more generally, it's OK to keep model definitions in different files, but note that the files are executed in alphabetical order, so if you want an object to be available in one file, make sure it is defined in a file that comes earlier in alphabetical order. In this case, that isn't strictly necessary because you can use the 'reference event_instance' syntax to refer to tables that have not yet been defined.

Anthony
Reply all
Reply to author
Forward
0 new messages