aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorTom Christie2011-04-28 19:54:30 +0100
committerTom Christie2011-04-28 19:54:30 +0100
commit93aa065fa92f64472a3ee80564020a81776be742 (patch)
treed1bfa96d3027545006b7a0f542a32f53a946153b /examples
parentad552107ff9b6f844982bd3c562d69f890febf1f (diff)
downloaddjango-rest-framework-93aa065fa92f64472a3ee80564020a81776be742.tar.bz2
emitters -> renderers
Diffstat (limited to 'examples')
-rw-r--r--examples/mixin/urls.py6
-rw-r--r--examples/pygments_api/views.py10
-rw-r--r--examples/sandbox/views.py6
3 files changed, 11 insertions, 11 deletions
diff --git a/examples/mixin/urls.py b/examples/mixin/urls.py
index 96b630e3..f4300f41 100644
--- a/examples/mixin/urls.py
+++ b/examples/mixin/urls.py
@@ -1,6 +1,6 @@
from djangorestframework.compat import View # Use Django 1.3's django.views.generic.View, or fall back to a clone of that if Django < 1.3
from djangorestframework.mixins import ResponseMixin
-from djangorestframework.emitters import DEFAULT_EMITTERS
+from djangorestframework.renderers import DEFAULT_RENDERERS
from djangorestframework.response import Response
from django.conf.urls.defaults import patterns, url
@@ -9,8 +9,8 @@ from django.core.urlresolvers import reverse
class ExampleView(ResponseMixin, View):
"""An example view using Django 1.3's class based views.
- Uses djangorestframework's EmitterMixin to provide support for multiple output formats."""
- emitters = DEFAULT_EMITTERS
+ Uses djangorestframework's RendererMixin to provide support for multiple output formats."""
+ renderers = DEFAULT_RENDERERS
def get(self, request):
response = Response(200, {'description': 'Some example content',
diff --git a/examples/pygments_api/views.py b/examples/pygments_api/views.py
index 4e6d1230..278e8250 100644
--- a/examples/pygments_api/views.py
+++ b/examples/pygments_api/views.py
@@ -4,7 +4,7 @@ from django.core.urlresolvers import reverse
from djangorestframework.resource import Resource
from djangorestframework.response import Response
-from djangorestframework.emitters import BaseEmitter
+from djangorestframework.renderers import BaseRenderer
from djangorestframework import status
from pygments.formatters import HtmlFormatter
@@ -32,8 +32,8 @@ def remove_oldest_files(dir, max_files):
[os.remove(path) for path in list_dir_sorted_by_ctime(dir)[max_files:]]
-class HTMLEmitter(BaseEmitter):
- """Basic emitter which just returns the content without any further serialization."""
+class HTMLRenderer(BaseRenderer):
+ """Basic renderer which just returns the content without any further serialization."""
media_type = 'text/html'
@@ -68,8 +68,8 @@ class PygmentsRoot(Resource):
class PygmentsInstance(Resource):
"""Simply return the stored highlighted HTML file with the correct mime type.
- This Resource only emits HTML and uses a standard HTML emitter rather than the emitters.DocumentingHTMLEmitter class."""
- emitters = (HTMLEmitter,)
+ This Resource only emits HTML and uses a standard HTML renderer rather than the renderers.DocumentingHTMLRenderer class."""
+ renderers = (HTMLRenderer,)
def get(self, request, unique_id):
"""Return the highlighted snippet."""
diff --git a/examples/sandbox/views.py b/examples/sandbox/views.py
index 5b84e8e4..04e4da41 100644
--- a/examples/sandbox/views.py
+++ b/examples/sandbox/views.py
@@ -11,14 +11,14 @@ class Sandbox(Resource):
All the example APIs allow anonymous access, and can be navigated either through the browser or from the command line...
- bash: curl -X GET http://api.django-rest-framework.org/ # (Use default emitter)
- bash: curl -X GET http://api.django-rest-framework.org/ -H 'Accept: text/plain' # (Use plaintext documentation emitter)
+ bash: curl -X GET http://api.django-rest-framework.org/ # (Use default renderer)
+ bash: curl -X GET http://api.django-rest-framework.org/ -H 'Accept: text/plain' # (Use plaintext documentation renderer)
The examples provided:
1. A basic example using the [Resource](http://django-rest-framework.org/library/resource.html) class.
2. A basic example using the [ModelResource](http://django-rest-framework.org/library/modelresource.html) class.
- 3. An basic example using Django 1.3's [class based views](http://docs.djangoproject.com/en/dev/topics/class-based-views/) and djangorestframework's [EmitterMixin](http://django-rest-framework.org/library/emitters.html).
+ 3. An basic example using Django 1.3's [class based views](http://docs.djangoproject.com/en/dev/topics/class-based-views/) and djangorestframework's [RendererMixin](http://django-rest-framework.org/library/renderers.html).
4. A generic object store API.
5. A code highlighting API.
6. A blog posts and comments API.