def dispatch(self): o = Offer.objects.get_or_404(path=self.path) o.set_visit() if session.get('userinfo', None): region_id = session['userinfo']['region'].get('id', None) \ if session['userinfo'].get('region', None) else None else: region_id = None return 'offer.html', { 'region_id': region_id, 'offer': o, 'category': o.parent, 'has_active': True, 'breadcrumbs': o.get_breadcrumbs(), 'reviews': o.get_reviews(), 'related_offers': o.get_related(), 'popular_offers': Offer.get_popular().filter(id__ne=o.id)[:12], 'banners': Banner.get_banners('wide') }
def index(): return render_template('index.html', popular_offers=Offer.get_popular()[:8], special_offers=Offer.get_special_offers()[:12], banners=Banner.get_banners())