Rudolph wrote: > parent = models.ForeignKey('Item', blank = True, null = True, > related_name = 'child',) > > When trying to get the childs of an object by issueing > item.child_set.all(), it raises an exception: > 'Item' object has no attribute 'child_set'.
Because you used related_name='child', you must also use item.child.all(). It seems that _set stuff is added only when relation name is not explicitly given. -- Nebojša Đorđević - nesh Studio Quattro - Niš - SCG http://studioquattro.biz/ http://djnesh.blogspot.com/ | http://djnesh-django.blogspot.com/ | http://djangoutils.python-hosting.com/ Registered Linux User 282159 [http://counter.li.org] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---