remotes/origin/stage6
Alexander Burdeinyi 9 years ago
parent cef8eaf4c7
commit ee05209198
  1. 2
      article/models.py
  2. 4
      templates/client/article/article.html

@ -270,7 +270,7 @@ class Article(TranslatableModel):
themes = self.theme.all().values_list('pk', flat=True)
exclude_pks = set([self.pk])
qs = model.objects.language()\
.filter(type=self.type, publish_date__isnull=False).distinct().order_by('-publish_date')
.filter(type=self.type, draft=False, publish_date__isnull=False).distinct().order_by('-publish_date')
tags_sim = qs.filter(tag__in=tags).exclude(pk__in=exclude_pks)[:4]
exclude_pks.update([x.pk for x in tags_sim])
themes_sim = qs.filter(theme__in=themes).exclude(pk__in=exclude_pks)[:4]

@ -38,9 +38,9 @@
<li>Раздел: <a href="/blogs/theme/{{ object.theme.all.0.url }}"> {{ object.theme.all.0 }} </a></li>
</ul>
{# <strong><span>{{ object.publish_date|date:"d E Y" }}</span></strong> #}
{% if object.theme.all.exists %}
{% if object.tag.all.exists %}
<div class="article_tags">
{% trans 'Теги:' %}&nbsp;&nbsp; {% include 'includes/article_tags.html' with obj=object %}
{% trans 'Теги:' %}&nbsp;&nbsp; {% include 'client/includes/article_tags.html' with obj=object %}
</div>
{% endif %}

Loading…
Cancel
Save