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
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
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
3 matches
Mail list logo