mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 01:47:59 +03:00 
			
		
		
		
	Style tweaks
This commit is contained in:
		
							parent
							
								
									49f87cfbab
								
							
						
					
					
						commit
						ee8ab283f0
					
				| 
						 | 
				
			
			@ -10,8 +10,18 @@ def api_view(http_method_names):
 | 
			
		|||
 | 
			
		||||
    def decorator(func):
 | 
			
		||||
 | 
			
		||||
        class WrappedAPIView(APIView):
 | 
			
		||||
            pass
 | 
			
		||||
        WrappedAPIView = type(
 | 
			
		||||
            'WrappedAPIView',
 | 
			
		||||
            (APIView,),
 | 
			
		||||
            {'__doc__': func.__doc__}
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        # Note, the above allows us to set the docstring.
 | 
			
		||||
        # It is the equivelent of:
 | 
			
		||||
        #
 | 
			
		||||
        #     class WrappedAPIView(APIView):
 | 
			
		||||
        #         pass
 | 
			
		||||
        #     WrappedAPIView.__doc__ = func.doc    <--- Not possible to do this
 | 
			
		||||
 | 
			
		||||
        allowed_methods = set(http_method_names) | set(('options',))
 | 
			
		||||
        WrappedAPIView.http_method_names = [method.lower() for method in allowed_methods]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -59,6 +59,7 @@ pre {
 | 
			
		|||
.page-header {
 | 
			
		||||
    border-bottom: none;
 | 
			
		||||
    padding-bottom: 0px;
 | 
			
		||||
    margin-bottom: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -109,7 +109,7 @@
 | 
			
		|||
 | 
			
		||||
        <div class="content-main">
 | 
			
		||||
            <div class="page-header"><h1>{{ name }}</h1></div>
 | 
			
		||||
            <p class="resource-description">{{ description }}</p>
 | 
			
		||||
            {{ description }}
 | 
			
		||||
 | 
			
		||||
            <div class="request-info">
 | 
			
		||||
                <pre class="prettyprint"><b>{{ request.method }}</b> {{ request.get_full_path }}</pre>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user