~chipaca/unity-lens-video/custom-user-agent

« back to all changes in this revision

Viewing changes to main/views.py

  • Committer: Janos Gyerik
  • Date: 2011-08-08 20:10:43 UTC
  • Revision ID: janos@axiom-20110808201043-8yzrw88s5xvo6km2
added OneLiner.top_n method for convenience, with unit tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
    return render_to_response('main/index.html', params)
33
33
 
 
34
def top_n(request, num):
 
35
    params = get_common_params(request)
 
36
    params['oneliners'] = OneLiner.objects.filter(is_published=True).order_by('-vote')
 
37
 
 
38
    return render_to_response('main/top_n.html', params)
 
39
 
34
40
def oneliner(request, pk):
35
41
    return index(request)
36
42