I used Turbogears 2.3.11. I have 1 application and 2 Pluggable Applications with TurboGears. In Pluggable Applications have own models. How to call model in one Pluggable Application from two Pluggable Application?
In example:
- mainapp
-- model
--- __init__.py
--- auth.py
- plugapp_one
-- model
--- __init__.py
--- models.py
---- Book
- plugapp_two
-- model
--- __init__.py
--- models.py
---- Buyer
---- Card
In Card Object call relation to Book Object, I use app_model.Book. It error
AttributeError: 'module' object has no attribute 'Book'
My Code in models.py of plugapp_two
from tgext.pluggable import app_model, primary_key
class Card(DeclarativeBase):
__tablename__ = 'card'
uid = Column(Integer, autoincrement=True, primary_key=True)
name = Column(Unicode(16))
id_book = Column(Integer, ForeignKey(primary_key(app_model.Book)))
book = relation(app_model.Book)