def portfolio_page(request, curr_work=None): c = get_common_context(request) if curr_work: c['curr_work'] = Work.get_by_slug(curr_work) return render_to_response('portfolio_work.html', c, context_instance=RequestContext(request)) else: c['tags'] = WorkTag.get_work_tags() c['works'] = Work.objects.all() return render_to_response('portfolio.html', c, context_instance=RequestContext(request))
def portfolio_page(request, curr_cat=None, curr_work=None): c = get_common_context(request) c['categories'] = Category.get_not_empty() c['curr_cat'] = Category.get_by_slug(curr_cat) if c['curr_cat'] is None: c['curr_cat'] = c['categories'][0] c['curr_work'] = Work.get_by_slug(curr_work) if c['curr_work'] is None: c['curr_work'] = Work.get_first_in_category(c['curr_cat']) return render_to_response('portfolio.html', c, context_instance=RequestContext(request))