def index request news_list News objects all return render_to_response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
def index(request):
news_list = News.objects.all()
return render_to_response('index.html', {'news_list': news_list})
@render_to('index.html')
# @NinjaPaginator(style='muzx', per_page=2)
#@NinjaPaginator(style='filmfeed', per_page=2)
@NinjaPaginator(style='digg', per_page=3)
def list_news(request):
news_list = News.objects.all().order_by('-pub_date')
return {'object_list': news_list}
def view(request):
news_list = News.objects.all()
return render_to_response('index.html', {'news_list': news_list})