Allow extra_data__field_name params in update and create

Review Request #7669 — Created Oct. 1, 2015 and submitted

brennie
RBTools
master
rbtools

The resource create and update methods now accept keyword arguments
of the form extra_data__field_name which are rewritten to
extra_data.field_name so that Review Board can understand them. This
occurs because extra_data.field_name cannot be used as a keyword
argument, so all extra data field updates have to built into a dict,
which must then be splatted into the appropriate method.

Unit tests have been updated that cover both methods.

Ran unit tests.

  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/api/tests.py
        rbtools/api/resource.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/tests.py
        rbtools/api/resource.py
    
    
  2. 
      
  1. This will be a way more intuitive way to provide extra data. And the comment block is descriptive and easily understood.
    Looks good to me. ^^

  2. 
      
chipx86
  1. 
      
  2. rbtools/api/resource.py (Diff revision 1)
     
     
     

    Blank line between these.

  3. rbtools/api/resource.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     

    Hmm, we're repeating quite a bit of code here. Let's get all this moved into a utility function.

  4. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/api/tests.py
        rbtools/api/resource.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/tests.py
        rbtools/api/resource.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (e35445f)
Loading...