Greg_IAP napisaĆ(a): > Hello, > > i have 3 classes. > > class Image(models.Model): > name = models.CharField(max_length = 20,blank=True) > instrument = models.ForeignKey(Instrument,null=True,blank= > True,db_column='instrument_id') > channel = models.ForeignKey(Channel,null=True,blank= > True,db_column='channel_id') > ... > > class Instrument(models.Model): > name = models.CharField(max_length = 240, blank=True) > ... > > class Channel(models.Model): > name = models.CharField(max_length = 80,blank=True) > ... > > I just want to make a join through this tables with the select_related > to be able to print Image.name, Instrument.name, Channel.name
The docs say select_related() does not follow foreign keys that have null=True. In your example it would do nothing. -- Jarek Zgoda Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101 "We read Knuth so you don't have to." (Tim Peters) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---

