should_read same country

This commit is contained in:
Kuroshini 2020-01-24 17:54:30 +03:00
parent 36c4641ed0
commit c82362b268

View File

@ -136,6 +136,7 @@ class NewsQuerySet(TranslationQuerysetMixin):
def should_read(self, news, user):
return self.model.objects.exclude(pk=news.pk).published(). \
annotate_in_favorites(user). \
filter(country=news.country). \
with_base_related().by_type(news.news_type).distinct().order_by('?')
def same_theme(self, news, user):