{{ name }}
{{ description }}
+ {{ description }}{{ request.method }} {{ request.get_full_path }}
--
cgit v1.2.3
From ee8ab283f091b73e284c74a11882f910a04eb2de Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 29 Oct 2012 14:41:33 +0000 Subject: Style tweaks --- rest_framework/decorators.py | 14 ++++++++++++-- rest_framework/static/rest_framework/css/default.css | 1 + rest_framework/templates/rest_framework/base.html | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'rest_framework') 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 @@
{{ description }}
+ {{ description }}{{ request.method }} {{ request.get_full_path }}
--
cgit v1.2.3