Hi, You can use custom template tag. More details in Django docs https://docs.djangoproject.com/en/4.0/howto/custom-template-tags/.
wtorek, 5 lipca 2022 o 06:59:56 UTC+2 loharroh...@gmail.com napisaĆ(a): > I want to access the data from the model but specific data > > like I am writing the code in python below i want it to implement in > django template > and model used is grade > > for i in range(1,20): > c = "metalc"+str(i) > n = "metaln" + str(i) > if(grade.c!=0 and grade.n!=0) > {{ grade.c }} {{ grade.n }} > > > like this > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/365e11c0-12e8-4173-9cd0-66800fccf942n%40googlegroups.com.