The problem with using Mixins is that you need to know the definition of
columns already for creating the mixin class. What I am trying to do is
more like get the definition dynamically on the fly.Take a look at this:
def get_properties(tablename, map):
table_inspector =
Sorry, it should've been:
class Enum_Sample(Base):
Typo.
On Mon, Aug 26, 2013 at 4:35 PM, Praveen praveen.venk...@gmail.com wrote:
The problem with using Mixins is that you need to know the definition of
columns already for creating the mixin class. What I am trying to do is
more like get
On Aug 26, 2013, at 4:35 PM, Praveen praveen.venk...@gmail.com wrote:
The problem with using Mixins is that you need to know the definition of
columns already for creating the mixin class. What I am trying to do is more
like get the definition dynamically on the fly.Take a look at this:
On Aug 26, 2013, at 5:16 PM, Michael Bayer mike...@zzzcomputing.com wrote:
On Aug 26, 2013, at 4:35 PM, Praveen praveen.venk...@gmail.com wrote:
The problem with using Mixins is that you need to know the definition of
columns already for creating the mixin class. What I am trying to do
OK here we are, had to switch approaches due to a bug with the column reflect
event, to use the aforementioned __mapper_cls__ (had the name wrong), so I
think you'll see this is a pretty open-ended way to control how something maps
as you're given total access to mapper() here:
from sqlalchemy
Does this work in sqlalchemy 0.6.1 ?
On Mon, Aug 26, 2013 at 5:36 PM, Michael Bayer mike...@zzzcomputing.comwrote:
OK here we are, had to switch approaches due to a bug with the column
reflect event, to use the aforementioned __mapper_cls__ (had the name
wrong), so I think you'll see this is
I am getting ImportError for the following:
from sqlalchemy.ext.declarative import DeferredReflection
from sqlalchemy import event
I use sqlalchemy 0.6.1. Is there any way I can make it work in 0.6.1 ?
On Mon, Aug 26, 2013 at 5:38 PM, Praveen praveen.venk...@gmail.com wrote:
Does this work
you'd need to hand-roll the deferred reflection part, there's an example in 0.7
called declarative_reflection but it might require features that aren't in
0.6.
I'd not be looking to add any kind of slick/magic systems to an 0.6 app, 0.6 is
very early in the curve for declarative techniques.
Could you please point me to the link where I can find the example ?
On Mon, Aug 26, 2013 at 5:41 PM, Michael Bayer mike...@zzzcomputing.comwrote:
you'd need to hand-roll the deferred reflection part, there's an example
in 0.7 called declarative_reflection but it might require features that
nvm... i found it.
On Mon, Aug 26, 2013 at 5:46 PM, Praveen praveen.venk...@gmail.com wrote:
Could you please point me to the link where I can find the example ?
On Mon, Aug 26, 2013 at 5:41 PM, Michael Bayer
mike...@zzzcomputing.comwrote:
you'd need to hand-roll the deferred reflection
I tried your example in sqlalchemy 0.6 by manually plugging in api.py
library (attached) that I got from
herehttps://bitbucket.org/miracle2k/sqlalchemy/src/2d28ed97d3221a133b4b297a229deb294088affe/lib/sqlalchemy/ext/declarative/api.py?at=default
.
I get this error:
File path\to\sample_orm.py,
your metaclass must derive from the DeclarativeMeta class.
Also, I disagree that you need this metaclass, what you're trying to do is
very easy using mixins, which are supported in version 0.6:
http://docs.sqlalchemy.org/en/rel_0_6/orm/extensions/declarative.html#mixing-in-columns
On Jul
12 matches
Mail list logo