>>> faq_db = Faq.objects.all().distinct() >>> a = [] >>> for f in faq_db: ... a.append(Question.objects.filter(faq=f).count()) ... ... Traceback (most recent call last): File "", line 2, in AttributeError: 'module' object has no attribute 'append'