There should be no problem spreading your table definitions over multiple model files. However, the db object itself must be defined in a model file that is executed *before* any other model files in which tables are defined. You could name that model file something like 0.py to ensure it runs before any other model files (model files are executed in alphabetical order).
Anthony On Monday, August 29, 2016 at 8:47:39 AM UTC-4, Brian Boatright wrote: > > Thanks Anthony! > > All the db tables were defined in separate model files, which is what I > would prefer, but as a last attempt to resolve the conflict I moved them > all to a single models.py model file and arranged a few of the declarations > to avoid that error. It is working now but I would have preferred the > models in separate files, but maybe that's not possible when they have so > many foreign keys. > > Is it possible to stage the order which the model files are read so table > declarations will be in the right sequence > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.