I'm having a hard time figuring out SQLAlchemy constructors http://docs.sqlalchemy.org/en/latest/orm/constructors.html What I would like is to pass a schema parameter to a class constructor as follows but I get 'self' is not defined errors.
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
__table_args__ = {'schema' : self.s}
def __init__(self, s):
self.s = s
u = User('customschema')