views.py

def index(request):
             allProds = []
catprods = Allmusic.objects.values('category', 'sno') 
cats = {item['category'] for item in catprods} for cat in cats: prod = 
Allmusic.objects.filter(category=cat) n = len(prod) nSlides = n // 4 + 
ceil((n / 4) - (n // 4)) allProds.append([prod, range(1, nSlides), nSlides])
params = {'allProds':allProds}
return render(request,'index.html',params) 

index.html



For More details you can see my stackoverflow page
https://stackoverflow.com/questions/64207103/when-i-click-on-slide-button-of-slider-in-my-website-it-only-slides-only-once-an




   






-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/49c95009-8d05-4f71-bccb-1bcec2e97d26n%40googlegroups.com.
{% extends 'base.html' %} {% block title %} DdsMusic.com Best Music Website! {% endblock %} {% block css %} .col-md-3 { display: inline-block; margin-left:-4px; } .carousel-indicators .active { background-color: blue; } .col-md-3 img{ width:276px; height: 217px; } .card-img, .card-img-top { border-top-left-radius: calc(.25rem - 1px); border-top-right-radius: calc(.25rem - 1px); } .card-img-top { -ms-flex-negative: 0; flex-shrink: 0; width: 100%; } body .carousel-indicator li{ background-color: blue; } body .carousel-indicators{ bottom: -40px; } .carousel-indicators li { background-color: #7270fc; } body .carousel-control-prev-icon, body .carousel-control-next-icon{ background-color: blue; } .carousel-control-prev, .carousel-control-next{ top: auto; bottom: auto; padding-top: 222px; } body .no-padding{ padding-left: 0, padding-right: 0; } #headcat1{ font-family:sans-serif; font-style:bold; } .categorywid{ font-size:40px; font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif; } {% endblock%} {% block body %} {%load static%}
{% for product, range, nSlides in allProds %}
{{product.0.category}}
{% endfor %}
{% endblock body %}

Reply via email to