コード例 #1
0
 def render(self, context):
     section = context['section']
     settings = context['settings']
     banners = settings.get_section_banners(section)
     context = {
         'banners': banners,
     }
     return render_to_string('desktop/inclusion_tags/widgets/advert.html', context)
コード例 #2
0
 def render(self, context):
     """
     Render a single advertising banner as specified in the Settings 
     object's banner section home field. Only public banners are rendered
     """
     section = context['section']
     settings = context['settings']
     banners = settings.get_section_banners(section)
     return banners[0].render() if banners else ""