Add support for resource-specific mimetypes.

Review Request #2750 — Created Dec. 17, 2011 and submitted

Information

Djblets

Reviewers

Add support for resource-specific mimetypes.

A common method for REST services is to have payloads returned with
resource-specific mimetypes. These can help to identify the format of a
payload (useful for automatic bindings) without having to inspect the
URI.

This adds support for easily telling a resource to return such
mimetypes. If mimetype_vendor is specified, WebAPIResource can populate
the accepted mimetypes list with some vendor/resource-specific mimetypes
that will be used by default for any responses.

When there's a vendor mimetype, the resources will use the resource
names for the mimetypes, but these can be overridden using
mimetype_list_resource_name and mimetype_item_resource_name.
Unit tests pass.

Tested with my Review Board change, which thoroughly tests all this functionality.
Also verified by hand.
chipx86
david
  1. Ship It!
  2. 
      
WA
  1. Ship It!
    1. This is not a demo server. Please don't post here for test. Use demo.reviewboard.org instead.
  2. 
      
WA
  1. Ship It!
    1. yes? I am happy to see this .
      
      updated2222
  2. 
      
WA
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-1.6.x (89b16e35d953798411dd2b21190fbf14e72f34b6)