Merge pull request #1256 from minddust/fix_docs_sample

Fix TemplateHTMLRenderer example
This commit is contained in:
Tom Christie 2013-12-02 02:46:16 -08:00
commit 01040b077c

View File

@ -167,14 +167,14 @@ The template name is determined by (in order of preference):
An example of a view that uses `TemplateHTMLRenderer`: An example of a view that uses `TemplateHTMLRenderer`:
class UserDetail(generics.RetrieveUserAPIView): class UserDetail(generics.RetrieveAPIView):
""" """
A view that returns a templated HTML representations of a given user. A view that returns a templated HTML representations of a given user.
""" """
queryset = User.objects.all() queryset = User.objects.all()
renderer_classes = (TemplateHTMLRenderer,) renderer_classes = (TemplateHTMLRenderer,)
def get(self, request, *args, **kwargs) def get(self, request, *args, **kwargs):
self.object = self.get_object() self.object = self.get_object()
return Response({'user': self.object}, template_name='user_detail.html') return Response({'user': self.object}, template_name='user_detail.html')