2012-04-26 03:17:47 +08:00
|
|
|
from django.core.xheaders import populate_xheaders
|
2010-01-11 01:21:52 +08:00
|
|
|
from django.http import HttpResponse
|
|
|
|
from django.utils.decorators import decorator_from_middleware
|
2010-10-19 07:58:06 +08:00
|
|
|
from django.views.generic import View
|
2010-01-11 01:21:52 +08:00
|
|
|
from django.middleware.doc import XViewMiddleware
|
|
|
|
|
2012-04-26 03:17:47 +08:00
|
|
|
from .models import Article
|
|
|
|
|
2010-01-11 01:21:52 +08:00
|
|
|
xview_dec = decorator_from_middleware(XViewMiddleware)
|
|
|
|
|
|
|
|
def xview(request):
|
|
|
|
return HttpResponse()
|
2010-10-19 07:58:06 +08:00
|
|
|
|
2012-04-26 03:17:47 +08:00
|
|
|
def xview_xheaders(request, object_id):
|
|
|
|
response = HttpResponse()
|
|
|
|
populate_xheaders(request, response, Article, 1)
|
|
|
|
return response
|
|
|
|
|
2010-10-19 07:58:06 +08:00
|
|
|
class XViewClass(View):
|
2011-04-27 00:56:17 +08:00
|
|
|
def get(self, request):
|
2010-10-19 07:58:06 +08:00
|
|
|
return HttpResponse()
|