Re: ORM Prefetch related and only()

2013-05-29 Thread Àlex Pérez
As you say the raw sql always is the solution. But I take a few time to think how that could be possible with the ORM, and like akaariai says the prefetch_related get the values for de _default_manager. But if i defined a temporally manager that makes the only clausure it works, but i don't know

Re: ORM Prefetch related and only()

2013-05-29 Thread Christophe Pettus
On May 29, 2013, at 12:44 PM, Àlex Pérez wrote: > You know the way to simulate the behaviour that i want.? Raw SQL. At the point you are doing a multi-join query and selecting a subset of the fields to be returned, you probably should switch to raw SQL anyway. -- -- Christophe Pettus x...

Re: ORM Prefetch related and only()

2013-05-29 Thread Àlex Pérez
Ok thank's!!! but you thinks thats the normal behaviour? this could be included in future versions of the orm? You know the way to simulate the behaviour that i want.? 2013/5/29 akaariai > There is no way to alter the behavior of prefetch_related. It fetches > the related objects with the que

Re: ORM Prefetch related and only()

2013-05-29 Thread akaariai
There is no way to alter the behavior of prefetch_related. It fetches the related objects with the query defined by the related manager and that's it. - Anssi On 29 touko, 19:40, Àlex Pérez wrote: > I want to know if there is a way that the query that is executed to get the > prefetch related i

ORM Prefetch related and only()

2013-05-29 Thread Àlex Pérez
I want to know if there is a way that the query that is executed to get the prefetch related information can get only certains values, actually that only works for select_related, May be i have done something wrong but the prefetch_related query is getting all the fields of the model. Someone can