Hi, could someone advice me, please, how to split classes into
individual files?
I'm studying the documentation:
Creating Table, Class and Mapper All at Once Declaratively
<http://www.sqlalchemy.org/docs/05/ormtutorial.html#creating-table-
class-and-mapper-all-at-once-declaratively>.
If I keep all the classes in the same file, the program works fine.
If I try to split them into individual files, I'm getting errors like
NoReferencedTableError: Could not find table 'users' with which to
generate a foreign key

Are there some "Best practices" of how to do this?

Thanks.

c.

PS: All the classes are in their individual modules in a package
called database:
database
  /dbinit.py - common initialization (ex. Base = declarative_base())
  /mailevt.py - class MailEvent
  /mailogrec.py - class MailLogEvent (foreign keys to Server,
ObjAddress, MailEvent)
  /objaddr.py - class ObjAddress
  /server.py - class Server
  /user.py - class User
  /useraddr.py - class UserAddress (foreign key to User, ObjAddress)
  /vpnlogrec.py - class VpnLogRecord (foreign key to User, Server)
  /weblogrec.py - class WebLogRecord (foreign key to User, Server)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to