mirror of
				https://github.com/django/django.git
				synced 2025-10-26 07:06:08 +00:00 
			
		
		
		
	git-svn-id: http://code.djangoproject.com/svn/django/trunk@16976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
		
			
				
	
	
		
			30 lines
		
	
	
		
			920 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			920 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| # -*- coding:utf-8 -*-
 | |
| from __future__ import absolute_import
 | |
| 
 | |
| from django.views.decorators.http import condition, etag, last_modified
 | |
| from django.http import HttpResponse
 | |
| 
 | |
| from .models import FULL_RESPONSE, LAST_MODIFIED, ETAG
 | |
| 
 | |
| 
 | |
| def index(request):
 | |
|     return HttpResponse(FULL_RESPONSE)
 | |
| index = condition(lambda r: ETAG, lambda r: LAST_MODIFIED)(index)
 | |
| 
 | |
| def last_modified_view1(request):
 | |
|     return HttpResponse(FULL_RESPONSE)
 | |
| last_modified_view1 = condition(last_modified_func=lambda r: LAST_MODIFIED)(last_modified_view1)
 | |
| 
 | |
| def last_modified_view2(request):
 | |
|     return HttpResponse(FULL_RESPONSE)
 | |
| last_modified_view2 = last_modified(lambda r: LAST_MODIFIED)(last_modified_view2)
 | |
| 
 | |
| def etag_view1(request):
 | |
|     return HttpResponse(FULL_RESPONSE)
 | |
| etag_view1 = condition(etag_func=lambda r: ETAG)(etag_view1)
 | |
| 
 | |
| def etag_view2(request):
 | |
|     return HttpResponse(FULL_RESPONSE)
 | |
| etag_view2 = etag(lambda r: ETAG)(etag_view2)
 | |
| 
 |