  
      def get(self, request, auth, unique_id):
          pathname = os.path.join(HIGHLIGHTED_CODE_DIR, unique_id)
          if not os.path.exists(pathname):
              return Resource(status.HTTP_404_NOT_FOUND)
          return open(pathname, 'r').read()
  
  
 
</s> remove ##### Root Resource #####

class RootResource(Resource):
    """This is the top level resource for the API.
    All the sub-resources are discoverable from here."""
    allowed_methods = ('GET',)

    def get(self, request, *args, **kwargs):
        return Response(status.HTTP_200_OK,
                        {'blog-posts': self.reverse(BlogPostList),
                         'blog-post': self.reverse(BlogPostCreator)})


##### Blog Post Resources #####

 </s> add  </s> remove         return ('blogpost.views.CommentList', (), {'blogpost_id': self.key})

    @property
    @models.permalink
    def comment_url(self):
        """Link to a resource which can create a comment for this blog post."""
        return ('blogpost.views.CommentCreator', (), {'blogpost_id': self.key})
 </s> add         return ('blogpost.views.CommentRoot', (), {'blogpost_id': self.key}) </s> remove     allowed_methods = ('read',)
 </s> add     """Resource with default operations for list.
    TODO: provide filter/order/num_results/paging, and a create operation to create queries."""
    allowed_methods = ('GET',) </s> remove Blah blah blah, examples here.
 </s> add There's a few real world examples included with django-rest-framework.
These demonstrate the following use cases:

#. Using :class:`.Resource` for resources that do not map to models.
#. Using :class:`.Resource` with forms for input validation.
#. Using :class:`.ModelResource` for resources that map directly to models.

All the examples are freely available for testing in the sandbox here: http://api.django-rest-framework.org

.. toctree::
  :maxdepth: 1

  examples/objectstore
  examples/pygments
  examples/blogpost

How Tos
-------

.. toctree::
  :maxdepth: 2

  howto/usingcurl </s> remove     title = forms.CharField(required=False, help_text='(Optional)', max_length=100)
    linenos = forms.BooleanField(label='Show Line Numbers', required=False)
    lexer = forms.ChoiceField(choices=LEXER_CHOICES, initial='python')
    style = forms.ChoiceField(choices=STYLE_CHOICES, initial='friendly')
 </s> add     title = forms.CharField(required=False,
                            help_text='(Optional)',
                            max_length=100)
    linenos = forms.BooleanField(label='Show Line Numbers',
                                 required=False)
    lexer = forms.ChoiceField(choices=LEXER_CHOICES,
                              initial='python')
    style = forms.ChoiceField(choices=STYLE_CHOICES,
                              initial='friendly')
        """Return the highlighted snippet."""
  
      def get(self, request, auth, unique_id):
        """Return the highlighted snippet."""
          pathname = os.path.join(HIGHLIGHTED_CODE_DIR, unique_id)
          if not os.path.exists(pathname):
              return Resource(status.HTTP_404_NOT_FOUND)
          return open(pathname, 'r').read()
  
  
keep add keep keep keep keep keep keep
 Lots of docs, trying to tidy up examples... 
examples/pygments_api/views.py