Hi, As per my understanding, the thing you want to achieve can be done using the below code.
<ul class="a big"> {% for i in number %} <li class="a">{{i}}</li> {% endfor %} <li class="extra"></li> </ul> In that way, if the queryset contains 1 to 6 integers, you will loop over them and create 6 li items and place it inside ul tag element. Regards Chiranjeevi On Monday, 30 May 2022 at 15:36:07 UTC+5:30 jakartaman...@gmail.com wrote: > Hi Everyone > > I wanna question about the integer would input by models, with some class > ClassName > numb = models.IntegerField() > and the views is : > number = ClassName.objects.values_list('numb', flat=True).distinct() > then the templates is : > <ul class="a big"> > <li class="a">1</li> > <li class="a">2</li> > <li class="a">3</li> > <li class="a">4</li> > <li class="a">5</li> > <li class="extra"></li> > </ul> > so i call the number from django admin with > {% for i in numb %} > <li class="a">{{i}}</li> > <li class="a">{{i}}</li> > <li class="a">{{i}}</li> > <li class="a">{{i}}</li> > <li class="a">{{i}}</li> > <li class="extra">{{i}}</li> > {% endfor %} > I expect the html will showing : > 123456 the number split by the li class > but the current problem is, the number showing all in every <li>, be like > 123456 123456 123456 123456 123456 123456 > > I hope somebody will help me, Thank you > > Regards > > -- 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/b1d1d5bc-4972-4c9e-b533-127f4acb5befn%40googlegroups.com.