> The docs say select_related() does not follow foreign keys that have > null=True. In your example it would do nothing. >
It would. As Samuel points out, select_related's only job is to save you some database trips. The examples I cooked up above will work fine with or without select_related(). In this case, select_related won't save him any DB trips but the image.instrument and image.channel statements would still lead to the related objects (Django will simply make additional DB calls to follow those relations.) You can also get the same DB savings as select_related() by explicitly joining the instrument and channel tables using the .extra method and its tables keyword[1] [1] http://www.djangoproject.com/documentation/db-api/#extra-select-none-where-none-params-none-tables-none --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---