Improve serialization and parent URL computation for webapi.

Review Request #5608 — Created March 10, 2014 and submitted

Information

Djblets
master
a54bc38...

Reviewers

It was difficult in the past to override serialization of objects in
payloads, but there are times when you really want this.

Now, instead of directly looking up a serializer from the global
registry for a given object, we go through a function on the resource
itself. This defaults to looking up in the registry, but the resource
can override this in order to override any object it chooses that would
be represented in its payload.

Likewise, sometimes a resource needs to override the parent URL
computation for an object. It could already do this before, but it
didn't have access to all the variables that made up the URL. We now
pass **kwargs, like we do with most other similar functions.

Djblets and RB unit tests pass.

Made use of both the new additions in a new set of APIs for RBCommons.

david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Loading...