On Feb 10, 9:14 am, WC <l...@stump.com> wrote: > According to this bug report, select_related is supposed to return the > data, but it doesn't. Also, if I can't get the foreign key, is there > a way around this? All I really need is the id of the foreignKey > object. Any help would be much appreciated. I am a newbie to this > architecture.
According to the Django documentation [1], select_related will not work automatically with nullable=True ForeignKey fields. You can, however, specify the field yourself .. def getBlocks(): return Block.objects.all().select_related('self') [1] - http://docs.djangoproject.com/en/dev/ref/models/querysets/#id4 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.