Dynamic Serial Number

21 views
Skip to first unread message

kushal....@gmail.com

unread,
Aug 15, 2020, 11:59:45 PM8/15/20
to Django users
Greeting all, I want to put Serial Number instead of ID. How can i make dynamic SN in view. Thanks. 

Capture.PNG

neeraj garg

unread,
Aug 16, 2020, 12:14:24 AM8/16/20
to django...@googlegroups.com
You can put loop counter.

On Sun, Aug 16, 2020, 9:29 AM kushal....@gmail.com <kushal....@gmail.com> wrote:
Greeting all, I want to put Serial Number instead of ID. How can i make dynamic SN in view. Thanks. 

Capture.PNG

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/643e5056-b0a8-466d-8197-89c9982ec187n%40googlegroups.com.

shubham vashisht

unread,
Aug 16, 2020, 4:00:39 AM8/16/20
to django...@googlegroups.com
When you iterate using for tag in Django template, it provides a context for counting the loops which you can use it like 



{{ forloop.count }}

Reply all
Reply to author
Forward
0 new messages