Here is my model (shortened for brevity). It was generated by inspectdb. I am running Django 1.2 with mod_wsgi, on Ubuntu 10.04 and apache2.
class CsInvHold(models.Model): action = models.CharField(max_length=3, db_column='Action', blank=True) # Field name made lowercase. . . . inventory_ok = models.IntegerField(null=True, blank=True) last_update = models.DateTimeField() class Meta: db_table = u'cs_inv_hold' This is from my views.py, try: cs_hold_rec_count = CsInvHold.objects.count() cs_hold_rec_list = CsInvHold.objects.filter(inventory_ok=0) except ObjectDoesNotExist: cs_hold_rec_count = 0 if request.method == 'POST': if 0 == cs_hold_rec_count: errors.append('There are no customer synch records on hold.') else: rc = sendCsHoldRpt(cs_hold_rec_list) if 1 == rc: errors.append('There were no recipients defined for the report.') return_dc['errors'] = errors return_dc['cs_hold_rec_count'] = cs_hold_rec_count return render_to_response('reconcile_inv.html', return_dc, context_instance=RequestContext(request)) The .count() function works perfectly. What am I doing wrong to get an object instance instead of the list? Thank you. -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.