Is there an option to add prefix to database tablename?
 

Consider this. There are multiple askbot instances running as apps in a single django project.

How are the database write duplicates handled? By using a different table prefix for each app. Like how Q2A does it.

I don't know if __tablename__ is for Sqlalchemy or Django ORM, but you get the idea For example:

TABLEPREFIX = "meta"

Class Posts(Modles.model):

    __tablename__ = TABLEPREFIX + "posts"

This way multiple sites like support, meta, questions etc can be achieved through a single project.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
mindme's avatar
21
mindme
asked 7 years ago

Comments

see more comments