Re: How to get the items of Foreign Key

2011-10-07 Thread Tom Evans
On Fri, Oct 7, 2011 at 9:02 AM, Tsung-Hsien wrote: > I give the item a Instance and use item.photo_set.all() > , but it shows error > > AttributeError: 'ForeignRelatedObjectsDescriptor' object has no > attribute 'all' > > I check the item has attribute of photo_set, but item.photo_set has no > att

Re: How to get the items of Foreign Key

2011-10-07 Thread Tsung-Hsien
I give the item a Instance and use item.photo_set.all() , but it shows error AttributeError: 'ForeignRelatedObjectsDescriptor' object has no attribute 'all' I check the item has attribute of photo_set, but item.photo_set has no attribute of all() How to solve this? thanks! On Oct 6, 11:50 pm, k

Re: How to get the items of Foreign Key

2011-10-06 Thread kenneth gonsalves
On Thu, 2011-10-06 at 23:31 -0700, Tsung-Hsien wrote: > class Item(models.Model): > name = models.CharField(max_length=250) > description = models.TextField() > > class Meta: > ordering = ["name"] > > def __unicode__(self): > return self.name > > c