Why on the page all the time displays a different number of records?

There is such a cycle. In Chrome for some reason always appears the same number of entries. In IE and Opera everything is fine. Resetting cache doesn't help.

{% for draft in drafts %}
 <div class="item">
 <div class="price-item">
 <a href="{% url 'draft_detail' draft.slug %}" class="upper">
 <div class="slideshow">
 {% thumbnail draft.img "800" crop="center" as image %}
 <img src="{{ image.url }}" alt="" style="z-index: 1; display: block;" />
 {% endthumbnail %}
 <div class="desc_box centered">
 <div class="label col-md-6 offset-md-3">
 <p class="name">ð°SS‡RS' in"– {{ draft.number }}</p>
 <p class="desc">{{ draft.title }}<br / >
 {{ draft.get_oven_display }}<br / >
 {{ draft.furnish }}<br />
 <span class="yellow">{{ draft.get_full_price|intcomma }} S.</span>
 <button class="btn btn-transparent btn-full upper white">RRR±RRR</button>
 {% endfor %}

from django.db.models import Q
from django.views.generic import ListView, DetailView

from flatcontent.views import FlatContentMixin
from .models import Draft

class DraftListView(FlatContentMixin, ListView):
 queryset = Draft.objects.filter(is_active=True).order_by('id')
 context_object_name = 'drafts'
 paginate_by = 120
 template_name = 'prices/prices.html'

class DraftListAjaxView(FlatContentMixin, ListView):
 paginate_by = 120
 queryset = Draft.objects.filter(is_active=True).order_by('id')
 context_object_name = 'drafts'
 template_name = 'prices/prices_ajax.html'

class DraftDetailView(DetailView):
 model = Draft
 template_name = 'prices/price_detail.html'

 def get_context_data(self, **kwargs):
 context = super(DraftDetailView, self).get_context_data(**kwargs)
 draft = Draft.objects.get(slug=self.kwargs['slug'])
 properties = draft.draftproperty_set.all()
 context['badges'] = properties.filter(~Q(img__exact="))
 return context
April 3rd 20 at 18:37
0 answer

Find more questions by tags Django