>
> 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