In an application I defined the following connection string and
tables:

db = DAL('postgres://...)

auth.settings.table_user = db.define_table('auth_user',
    Field(...),
 
Field('company_id',db.company,default='',notnull=True,ondelete='CASCADE',writable=False,readable=False),
    Field(...))

db.define_table('company',
    Field('company_name',length=54,default='',notnull=True),
    Field(...),
    migrate=False)


In this application the users are registered by an administrator, and
the whole cms application is auth.user.company_id driven. Now, I would
like to build a second application in which users register themselves.
Since these users can be linked to more than one company, I have to
introduce an auth_user_company table containing auth_user_id and
company_id. My first question is, can auth_user_id and company_id come
from different databases?

if so, the second application should be able to store data related to
personalizing views. e.g the first application contains a timetable.
Users query the timetable by entering activities and days in a
multiple select drop box. My second question is, can I define a table
in the second application called myTimetable which stores the
company_id and the contents of the two drop boxes and then base the
rendering of a personalized timetable on these data?


Kind regards,

Annet.

Reply via email to