Re: select_related(field) doesn't use the default manager of the field

2009-08-09 Thread Gleber
Thanks for the reply, This is much more complex than I thought.. I will stay with the way of two queries, better than one query per object.. Gleber --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group

Re: select_related(field) doesn't use the default manager of the field

2009-08-09 Thread Malcolm Tredinnick
On Sat, 2009-08-08 at 22:00 -0700, Gleber wrote: [...] > When I override the get_query_set() adding extra fields, these fields > aren't available if I execute: > ModelB.objects.all().select_related('ref') This is true. > This is a bug? Not necessarily. It's intentional behaviour at the moment

select_related(field) doesn't use the default manager of the field

2009-08-08 Thread Gleber
I have something like this: class MyManager(models.Manager): use_for_related_fields = True def get_query_set(self): return super(MyManager, self).get_query_set().extra(select = {'_extra_field':"xxx"}) class ModelA(models.Model): ... objects = MyManager() class ModelB(mode