On Jul 9, 11:27 am, Alex <alexle...@googlemail.com> wrote: > Hi Daniel, > > Models - > > class Reel(models.Model): > st = models.DateTimeField(auto_now_add=True) > et = models.DateTimeField(auto_now=True) > othermodel= models.ForeignKey(Othermodel) > > class Othermodel(models.Model): > name = models.CharField(max_length=100, blank=False) > > Code - > > om = Othermodel(name="Test") > om.save() > count = om.reel_set.count() #this causes the error > > Thanks, > Alex
Thanks, but the code you give can't generate the error "QuerySet' object has no attribute 'reel_set'", as om is not a QuerySet object. Please also post the actual error and traceback. -- DR. -- 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.