  class BlogPostResource(ModelResource):
      """
      A Blog Post has a *title* and *content*, and can be associated with zero or more comments.
      """
      model = BlogPost
      fields = ('created', 'title', 'slug', 'content', 'url', 'comments')
      ordering = ('-created',)
  
      def comments(self, instance):
          return reverse('comments', kwargs={'blogpost': instance.key}) 
  
  
 
</s> remove         return property_fields.union(set(as_tuple(self.include))) - set(as_tuple(self.exclude))
 </s> add         return property_fields.union(set(as_tuple(self.Meta.include))) - set(as_tuple(self.Meta.exclude)) </s> remove         return _object_to_data(obj, self)
 </s> add         return self.serialize(obj) </s> remove # TODO: _IgnoreFieldException
 </s> add 
    class Meta:
        model = BlogPost
        fields = ('created', 'title', 'slug', 'content', 'url', 'comments')
        ordering = ('-created',)
  class BlogPostResource(ModelResource):
      """
      A Blog Post has a *title* and *content*, and can be associated with zero or more comments.
      """
    class Meta:
        model = BlogPost
        fields = ('created', 'title', 'slug', 'content', 'url', 'comments')
        ordering = ('-created',)
    class Meta:
        model = BlogPost
        fields = ('created', 'title', 'slug', 'content', 'url', 'comments')
        ordering = ('-created',)
    class Meta:
        model = BlogPost
        fields = ('created', 'title', 'slug', 'content', 'url', 'comments')
        ordering = ('-created',)
  
      def comments(self, instance):
          return reverse('comments', kwargs={'blogpost': instance.key}) 
  
  
keep keep keep keep replace replace replace keep keep keep keep keep
 Support for nesting resources etc...

--HG--
rename : djangorestframework/tests/resources.py => djangorestframework/tests/serializer.py 
examples/blogpost/urls.py