1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-28 12:44:38 +00:00

17 lines
482 B
Python
Raw Normal View History

from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect
from article.models import Article
def order_up(request, article_id):
article = get_object_or_404(Article, pk=article_id)
article.order_up()
return HttpResponseRedirect("/admin/article/article/")
def order_down(request, article_id):
article = get_object_or_404(Article, pk=article_id)
article.order_down()
return HttpResponseRedirect("/admin/article/article/")