Links can now be serialized by subclasses

Review Request #7333 — Created May 25, 2015 and submitted

Information

Djblets
master
91380ac...

Reviewers

The machinery for serializing links has been modified so that its
behvaiour can be changed by subclasses. The get_link_serializer
method takes a field name and returns the appropriate serializing
function for the link. The default function is serialize_link but
subclasses may provide a serialize_fieldname_link method that will be
used instead.

Tested the serialize_fieldname_link behaviour with a resource. It
worked as intended.

Ran unit tests.

Description From Last Updated

Let's make a utility function for this that does this work, so we can reuse it here and maybe in …

chipx86chipx86

Col: 42 E225 missing whitespace around operator

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/webapi/resources.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/webapi/resources.py
    
    
  2. 
      
chipx86
  1. 
      
  2. djblets/webapi/resources.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Let's make a utility function for this that does this work, so we can reuse it here and maybe in subclasses.

    Maybe get_link_serializer? Takes a field name, returns the function to use?

  3. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/webapi/resources.py
    
    
  2. djblets/webapi/resources.py (Diff revision 2)
     
     
    Show all issues
    Col: 42
     E225 missing whitespace around operator
    
  3. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/webapi/resources.py
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/webapi/resources.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/webapi/resources.py
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to master (c33bd0d)