Add support for resource-specific mimetypes.

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

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.