我正在升級到Django 1.5,此後不推薦使用通用視圖。我使用的是使用通用視圖的django-voting。我不知道如何翻譯成基於類此觀點:翻譯Django通用視圖的最佳方法
from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_list
from django.core.context_processors import request
from django.shortcuts import get_object_or_404, render_to_response
from blog.models import Blog
from voting.views import vote_on_object
from voting.models import Vote
import operator
urlpatterns = patterns('',
url(r'^links/(?P<object_id>\d+)/(?P<direction>up|down|clear)vote/?$',
vote_on_object,
dict(
model=Blog,
template_object_name='link',
template_name='blog/link_confirm_vote.html',
allow_xmlhttprequest=True,
),
name="link_vote",)
)
object_list中在Django被刪除1.5 – 2013-04-18 02:57:23