Well, it is trying to create the contacts table before it creates the 
customers table. That's the problem. I don't know if that's an issue in the 
DAL or if I just need to re-arrange the statements in my db.py - they are 
correctly ordered in the db.py - it seems that it wants to create the 
association before it actually creates the associated table. Not sure how I 
would test that in SQLite. Is that installed and running already?

On Thursday, March 22, 2012 6:11:46 AM UTC-7, Anthony wrote:
>
> I've seen both, and I think that the second doesn't make a foreign key 
>> constraint, it just creates an int field... not sure though.
>
>
> Field('customer', 'reference customers') and Field('customer', 
> db.customers) are equivalent (behind the scenes, when you do 
> type=db.customers, it is converted to type='reference customers'), and both 
> create a foreign key constraint. Note, your error is not about the 
> constraint but seems to indicate that "customers" is an invalid table. I'm 
> not sure why, though -- the model definition looks OK. Have you tried it on 
> SQLite?
>
> Anthony
>

On Thursday, March 22, 2012 6:11:46 AM UTC-7, Anthony wrote:
>
> I've seen both, and I think that the second doesn't make a foreign key 
>> constraint, it just creates an int field... not sure though.
>
>
> Field('customer', 'reference customers') and Field('customer', 
> db.customers) are equivalent (behind the scenes, when you do 
> type=db.customers, it is converted to type='reference customers'), and both 
> create a foreign key constraint. Note, your error is not about the 
> constraint but seems to indicate that "customers" is an invalid table. I'm 
> not sure why, though -- the model definition looks OK. Have you tried it on 
> SQLite?
>
> Anthony
>

Reply via email to