Using a different schema for the same declarative Base in sqlalchemy

前端 未结 3 1974
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-01 07:52

I am new to both Pyramid and SQLAlchemy. I am working on a Python Pyramid project with SQLAlchemy. I have a simple model set up below. How would I go about being able to use

3条回答
  •  旧巷少年郎
    2021-02-01 08:28

    You can have a base module in package model

    app\
        models\
            base.py
            schema1.py
            schema2.py
        views\
        ...
    

    declare Base in base.py, then import it to other schemas

提交回复
热议问题