Django debug error

Posted by Hulk on Stack Overflow See other posts from Stack Overflow or by Hulk
Published on 2010-03-25T05:22:23Z Indexed on 2010/03/25 5:33 UTC
Read the original article Hit count: 422

Filed under:
|
|

I have the following in my model:

 class info(models.Model):
     add = models.CharField(max_length=255)
     name = models.CharField(max_length=255)

An in the views when i say info_l = info.objects.filter(id=1) logging.debug(info_l.name)

i get an error saying name doesnt exist at debug statement. 'QuerySet' object has no attribute 'name' 1.How can this be resolved. 2.Also how to query for only one field instead of selecting all like select name from info.

© Stack Overflow or respective owner

Related posts about django

Related posts about django-views