Allow subclasses of RootResource to provide additional data.

Review Request #5287 — Created Jan. 21, 2014 and submitted

Information

Djblets
master

Reviewers

Allow subclasses of RootResource to provide additional data.

RootResource no longer hard-codes the structure of the resource data.
Subclasses can now override serialize_root() to provide additional data.

In order to allow caching to work correctly with custom data, we now use
a repr() of the data instead of assuming certain contents when
generating the SHA1 for the ETag.

Used this in Review Board to add some new data. Verified the original and
additional data was included.

Downloaded the resource and headers and saw the ETag. Ran with
curl -H 'If-None-Match: <etag> and saw that it returned a Not Modified.

Changed the payload and saw the ETag change.

Description From Last Updated

Can you explain this change and the testing you did for it?

daviddavid
david
  1. 
      
  2. djblets/webapi/resources.py (Diff revision 1)
     
     
     
     
    Show all issues

    Can you explain this change and the testing you did for it?

  3. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed