Fish Trophy

chipx86 got a fish trophy!

Fish Trophy

Add support for returning only certain fields or links in the API.

Review Request #6776 — Created Jan. 15, 2015 and submitted

Information

Djblets
master
d5d0062...

Reviewers

API resources now support a couple new query arguments for limiting the
results in a payload, in order to reduce database queries and payload
sizes.

The ?only-fields= query argument limits the returned fields in the
payload to the comma-separated list of field names. If the value is
blank, then no fields will be returned, leaving only links.

Likewise, the ?only-links= query argument limits the returned links in the
payload. It behaves exactly like ?only-fields=.

Resources that inject custom fields into the payload outside of
serialize_object() can call get_only_fields() and get_only_links() to
determine whether to include specific fields.

Unit tests pass.

Tested this pretty extensively with changes to rbt post and with custom
curl commands on several resources in Review Board.

Description From Last Updated

list comprehension redefines 'value' from line 1051

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/webapi/decorators.py
        djblets/webapi/resources.py
        djblets/webapi/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/webapi/decorators.py
        djblets/webapi/resources.py
        djblets/webapi/tests.py
    
    
  2. djblets/webapi/resources.py (Diff revision 1)
     
     
    Show all issues
     list comprehension redefines 'value' from line 1051
    
  3. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/webapi/decorators.py
        djblets/webapi/resources.py
        djblets/webapi/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/webapi/decorators.py
        djblets/webapi/resources.py
        djblets/webapi/tests.py
    
    
  2. 
      
david
  1. Should this include docs?

  2. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/webapi/decorators.py
        djblets/webapi/resources.py
        djblets/webapi/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/webapi/decorators.py
        djblets/webapi/resources.py
        djblets/webapi/tests.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (bc08cbf)
Loading...