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.

mindme's avatar
21
mindme
asked 2017-10-17 00:30:14 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments