0

I am new to web2py but am familiar with database design, Python and other web frameworks like Django. Web2py looks a really great frameowrk and I would like to use it to develop my current project.

For this project I would like to define two different databases in web2py. The first (db1) is the main data model and all my metadata is stored in this. The second (db2) contains data tables I will analyse as instructed by the metadata database.

I have initially looked to see if it is possible to define two different data model databases in web2py and it looks like it is https://groups.google.com/forum/#!topic/web2py/IbBzVyeCSFg

Unlike the example above, I would like to use data accessed from db1 to construct tables in db2. Rather than hardcode all the table and field names for db2 I would like to query them from db1 and construct the tables for db2 in this way. Is this possible?

heather
  • 31
  • 4

1 Answers1

1

Yep. It's quite simple, actually. In your models, after the definition of the DAL and table objects for db1, and the DAL object for the db2, you can do your DAL queries in db1 and call the db2.define_table(Field(...),...) method to do your job. If you need any further help, you should post some code snippet.

Hope it helped

Diogo Martins
  • 917
  • 7
  • 15