That's ok, it's works well for me.

Thank you.

Em terça-feira, 28 de fevereiro de 2017 11:15:21 UTC-3, Edu Ferreira 
escreveu:
>
> Hello, i’ve been doing a work which i need to use a custom collection with 
> lazy=’dynamic’, and i saw that it’s not possible, and the right way to do 
> this is inheritance “Query”, something like this:
>
> from sqlalchemy.orm import Query
>
> class MyCollection(Query): …
>
>
> and after: 
>
>
>
> Collector(object):…
>
>     mycollection = relationship(‘Whatever’, lazy=’dynamic’, query_class = 
>     MyCollection)
>
>
>
> but, which method do i need to override to get a custom access? like the 
> next methods that i overrid when i'm using collection_class.
>
> def append(self, i): …
>
>
> def __getitem__(self, i): …
>
>
> def __iter__(self): ... 
>
>
>
> i read the sqlalchemy code, so do i need to inheritance AppenderQuery too? 
> I tried to do this in many ways, but i didn’t have success, what is the 
> good way to do this?
>
>
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to