how can I get value of course_code
in this QuerySet?
<QuerySet [{'course_code': 11}]>
Use this
someTable.objects.all()[0]['course_code']
or
someTable.objects.values_list('course_code', flat = True)
course_qs = <whatever query gave you the queryset>
for course in course_qs:
print(course['course_code'])
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