I'm not sure if other people have stumbled onto this but I am having a
LOT of trouble getting the admin to use select related.

I have FK's that are nullable, this I know doesn't by default work
with select_related. But I've overridden the manager to select the
related fields I need (which I pretty much always need) and I still
can't get it to work. Here is my model def and the manager, if someone
could tell me if I am doing something stupid that would be awesome.

What's most frustrating is that select_related does not error or
interrupt in any way, so it seems as if it would work.

class PageManager(models.Manager):
    def get_query_set(self):
        return super(PageManager, self).get_query_set().select_related
('context__data_type')

class Page(models.Model):
    objects = PageManager()
    location = models.ForeignKey(Location, blank=True, null=True)
    template = models.ForeignKey(Template, blank=True, null=True)
    ...
    context = models.ForeignKey(DataObject, blank=True, null=True)

class DataObject(models.Model):
    data_type = models.ForeignKey(DataObjectType)
    ...

class DataObjectType(models.Model):
    ...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to