Greetings,
I was playing around and trying to extend the DeclarativeBase with
some "Elixir" like functions...
I may be to green in Python itself that I'm missing something though,
here's what I got...
class ModelBase(DeclarativeMeta):
@classmethod
def get(cls, id):
row = meta.Session.query(cls).filter_by(id=id).one()
return row
DeclarativeBase = declarative_base(metaclass=ModelBase)
metadata = DeclarativeBase.metadata
uhhh... so how does the introspection work here (if any)? I'm I a bit
too naive here? calling cls.__class__, cls.__table__, or
cls.__call__() doesn't seem to do it...
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.