def show_all(request): actions = Action.all().order('-add_time') paginator = Paginator(actions, 25) try: page = int(request.args.get('page',1)) except ValueError: page = 1 try: actions = paginator.page(page) except (EmptyPage, InvalidPage): actions = paginator.page(paginator.num_pages()) return render_to_response('news/admin/actions_all.html', {'actions':actions})
def index(request): newss = News.all().order('-add_time') actions = Action.all().order('-add_time') return render_to_response('news/index.html', {'newss': newss, 'actions':actions})