diff options
| author | Tom Christie | 2012-10-29 14:41:33 +0000 |
|---|---|---|
| committer | Tom Christie | 2012-10-29 14:41:33 +0000 |
| commit | ee8ab283f091b73e284c74a11882f910a04eb2de (patch) | |
| tree | 407b2d4de92edab7c9fc874111f9163e8c3c54cb | |
| parent | 49f87cfbabe036215cb97d2633d969e27c3915ce (diff) | |
| download | django-rest-framework-ee8ab283f091b73e284c74a11882f910a04eb2de.tar.bz2 | |
Style tweaks
| -rw-r--r-- | rest_framework/decorators.py | 14 | ||||
| -rw-r--r-- | rest_framework/static/rest_framework/css/default.css | 1 | ||||
| -rw-r--r-- | rest_framework/templates/rest_framework/base.html | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/rest_framework/decorators.py b/rest_framework/decorators.py index 948973ae..a231f191 100644 --- a/rest_framework/decorators.py +++ b/rest_framework/decorators.py @@ -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] diff --git a/rest_framework/static/rest_framework/css/default.css b/rest_framework/static/rest_framework/css/default.css index b46f025e..e29da395 100644 --- a/rest_framework/static/rest_framework/css/default.css +++ b/rest_framework/static/rest_framework/css/default.css @@ -59,6 +59,7 @@ pre { .page-header { border-bottom: none; padding-bottom: 0px; + margin-bottom: 20px; } diff --git a/rest_framework/templates/rest_framework/base.html b/rest_framework/templates/rest_framework/base.html index 5ac6ef67..e0f79481 100644 --- a/rest_framework/templates/rest_framework/base.html +++ b/rest_framework/templates/rest_framework/base.html @@ -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> |
