I currently have 2 apps which i would like to share one database.

one app is for authentication the other is the main app.
When I run the app1 it creates the auth tables along with another table 
called *base_tags*

when I run app2 I get the following error. (the base_tags table in app1 is 
referenced in app2 - same database).

*In App2*
<type 'exceptions.KeyError'> 'base_tags'

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 205, in restricted
    exec ccode in environment
  File "C:/web2py/applications/app2/models/db.py" 
<http://127.0.0.1:8000/admin/edit/histreet/models/db.py>, line 433, in <module>
    Field('tag_id', db.base_tags, label='Tag', required=True, notnull=True, 
writable=False, readable=False)
  File "C:\web2py\gluon\dal.py", line 6343, in __getattr__
    return self[key]
  File "C:\web2py\gluon\dal.py", line 6337, in __getitem__
    return dict.__getitem__(self, str(key))
KeyError: 'base_tags'


db.define_table('places_tags',
                Field('place_id', db.places, label='Place', required=True, 
notnull=True, writable=False, readable=False),
*line 433*:    Field('tag_id', *db.base_tags*, label='Tag', required=True, 
notnull=True, writable=False, readable=False)
                )


I am assuming that place_tags isn't seeing db.base_tags (no reference). May 
be I don't understand DAL.

1. Isn't DAL an interface to the database? 
2. If the database exist why wouldn't I be able to access it from another 
app and reference tables that already exist?
3. Should I assume that unless *base_tags* was defined in app2 I cannot 
access it?

Reply via email to