I'm having difficulty accessing the first related object within a template.
I'm using
{{ course.student_set.all[0].get() }}
but its throwing loads of errors. How do i get the first related object?
{{ course.student_set.all.0 }}
Will do the trick for you, but I wonder why you want to only get the first student from your course in your template.
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