def render(self, context):
        try:
            self.place = Place.objects.get(slug=self.place_slug)
        except Place.DoesNotExist:
            return ''

        try:
            banner_obj = Banner.objects.biased_choice(self.place)
            banner_obj.view()
        except Banner.DoesNotExist:
            banner_obj = None

        if self.varname:
            context.update({
                self.varname: banner_obj,
                '%s_place' % self.varname: self.place
            })
            return ''
        else:
            templates = [
                #'banner_rotator/place_%s.html' % place.slug,
                'banner_rotator/place.html'
            ]
            return render_to_string(templates, {
                'banner': banner_obj,
                'banner_place': self.place
            })
dataset/ETHPy150Open martinogden/django-banner-rotator/banner_rotator/templatetags/banners.py/BannerNode.render/original