Last active
August 29, 2015 14:22
-
-
Save mmerickel/3617a138635f4655afdc to your computer and use it in GitHub Desktop.
model with separate modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .meta import DBSession | |
from .users import User | |
from .entries import Entry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import ( | |
scoped_session, | |
sessionmaker, | |
) | |
import zope.sqlalchemy | |
Base = declarative_base() | |
DBSession = scoped_session(sessionmaker()) | |
zope.sqlalchemy.register(DBSession) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy.schema import Column | |
from sqlalchemy.types import Integer | |
from .meta import Base | |
class User(Base): | |
id = Column(Integer, primary_key=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment