Possible Duplicate:
Django get a model's fields
I have next model:
class People(models.Model):
name = models.CharField(max_length=100)
lastname = models.CharField(max_length=100)
I want to loop through all items from People table.
In views.py
-When I try this one:
for each in People().objects.all():
name=each.name
I am getting that error:
Manager isn't accessible via People instances
-When I try this one:
for each in People():
name=each.name
I am getting this error:
'People' object is not iterable
How can I fix that and how to loop through all items from my People table ?