Пример #1
0
 def render(self, request, place, context, *args, **kwargs):
     number_news = self.get_config().get('limit').get_value()
     news_list = self.get_queryset(request, context)[:number_news]
     if self.get_config().get('filtering_section', False) and not news_list:
         news_list = get_news(request, filtering_section=False)[:number_news]
     return self.render_block(request, template_name='news/block_latest.html',
                              block_title=ugettext('Latest news'),
                              context={'news_list': news_list})
Пример #2
0
 def render(self, request, place, context, *args, **kwargs):
     number_news = self.get_config().get('limit').get_value()
     news_list = self.get_queryset(request, context)[:number_news]
     if self.get_config().get('filtering_section', False) and not news_list:
         news_list = get_news(request,
                              filtering_section=False)[:number_news]
     return self.render_block(request,
                              template_name='news/block_latest.html',
                              block_title=ugettext('Latest news'),
                              context={'news_list': news_list})
Пример #3
0
 def render(self, request, place, context, *args, **kwargs):
     number_news = self.get_config().get("limit").get_value()
     news_list = self.get_queryset(request, context)[:number_news]
     if self.get_config().get("filtering_section", False) and not news_list:
         news_list = get_news(request, filtering_section=False)[:number_news]
     return self.render_block(
         request,
         template_name="news/block_latest.html",
         block_title=ugettext("Latest news"),
         context={"news_list": news_list},
     )
Пример #4
0
 def get_contents(self, request=None, context=None, section=None):
     news_list = get_news(request, filtering_section=False)
     return news_list
Пример #5
0
 def get_contents(self, request=None, context=None, section=None):
     news_list = get_news(request, filtering_section=False)
     return news_list