Hello,

any idea why with

# Query

class BaseQuery(orm.Query):
        @dynamic
        def method_a(self):
                ...
        def method_b(self):
                ...

class FooQuery(BaseQuery):
        ...

class BarQuery(FooQuery):
        @dynamic
        def method_c(self):
                ...

# Models

class BaseModel(object):
        query = Session.query_property(BaseQuery)

#

myQuery = type('PolymorphicQuery, (content.BaseQuery, ), func_list)(BaseModel)

where "func_list" containing all the functions decorated by @dynamic the following fail? :

- myQuery.get(45) fails with: AttributeError: 'NoneType' object has no attribute 'identity_map' - myQuery.method_a().all() fails with: AttributeError: 'NoneType' object has no attribute '_autoflush'
- etc

My goal is to be able to build a custom Query object to use with the .with_polymorphic() function ..

Thanks,
Julien

--
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

<<attachment: jcigar.vcf>>

Reply via email to