From 049d417ebc2c88b6aeed7946efdb3baeab9a4432 Mon Sep 17 00:00:00 2001 From: Ben Timby Date: Tue, 24 Jan 2012 14:11:10 -0500 Subject: [PATCH] Reverted formatting --- djangorestframework/renderers.py | 18 +++++++++--------- djangorestframework/templates/renderer.html | 11 ++++++++--- djangorestframework/views.py | 10 ++++++---- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/djangorestframework/renderers.py b/djangorestframework/renderers.py index 5338c3835..bb0f789aa 100644 --- a/djangorestframework/renderers.py +++ b/djangorestframework/renderers.py @@ -225,7 +225,6 @@ class DocumentingTemplateRenderer(BaseRenderer): return content - def _get_form_instance(self, view, method): """ Get a form, possibly bound to either the input or output data. @@ -261,7 +260,6 @@ class DocumentingTemplateRenderer(BaseRenderer): return form_instance - def _get_generic_content_form(self, view): """ Returns a form that allows for arbitrary content types to be tunneled via standard HTML forms @@ -340,7 +338,7 @@ class DocumentingTemplateRenderer(BaseRenderer): context = RequestContext(self.view.request, { 'content': content, 'view': self.view, - 'request': self.view.request, # TODO: remove + 'request': self.view.request, # TODO: remove 'response': self.view.response, 'description': description, 'name': name, @@ -402,12 +400,14 @@ class DocumentingPlainTextRenderer(DocumentingTemplateRenderer): template = 'renderer.txt' -DEFAULT_RENDERERS = ( JSONRenderer, - JSONPRenderer, - DocumentingHTMLRenderer, - DocumentingXHTMLRenderer, - DocumentingPlainTextRenderer, - XMLRenderer ) +DEFAULT_RENDERERS = ( + JSONRenderer, + JSONPRenderer, + DocumentingHTMLRenderer, + DocumentingXHTMLRenderer, + DocumentingPlainTextRenderer, + XMLRenderer +) if YAMLRenderer: DEFAULT_RENDERERS += (YAMLRenderer,) diff --git a/djangorestframework/templates/renderer.html b/djangorestframework/templates/renderer.html index 3b33a6ff3..ff761023f 100644 --- a/djangorestframework/templates/renderer.html +++ b/djangorestframework/templates/renderer.html @@ -11,9 +11,14 @@ /* Custom styles */ .version{font-size:8px;} - - - Django REST framework - {{ name }} + {% if ADMIN_MEDIA_PREFIX %} + + + {% else %} + + + {% endif %} + Django REST framework - {{ name }}
diff --git a/djangorestframework/views.py b/djangorestframework/views.py index 9dd84bf2a..d89c2afd9 100644 --- a/djangorestframework/views.py +++ b/djangorestframework/views.py @@ -27,7 +27,6 @@ __all__ = ( ) - class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): """ Handles incoming requests and maps them to REST operations. @@ -50,13 +49,13 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): List of parsers the resource can parse the request with. """ - authentication = ( authentication.UserLoggedInAuthentication, - authentication.BasicAuthentication ) + authentication = (authentication.UserLoggedInAuthentication, + authentication.BasicAuthentication) """ List of all authenticating methods to attempt. """ - permissions = ( permissions.FullAnonAccess, ) + permissions = (permissions.FullAnonAccess,) """ List of all permissions that must be checked. """ @@ -240,18 +239,21 @@ class ModelView(View): """ resource = resources.ModelResource + class InstanceModelView(InstanceMixin, ReadModelMixin, UpdateModelMixin, DeleteModelMixin, ModelView): """ A view which provides default operations for read/update/delete against a model instance. """ _suffix = 'Instance' + class ListModelView(ListModelMixin, ModelView): """ A view which provides default operations for list, against a model in the database. """ _suffix = 'List' + class ListOrCreateModelView(ListModelMixin, CreateModelMixin, ModelView): """ A view which provides default operations for list and create, against a model in the database.