I'm trying to access into a Database data through a Django view. The problem is that when I query it, it just returns me the result of the unicode function on the model. How can I access to the other fields of the model?
Thanks!
say you have a student database,
student_list = Student.objects.all()
for student in student_list:
print student.name
The other fields can be used in the iterator, using the dot(.
) operator
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With