Links can now be serialized by subclasses
Review Request #7333 — Created May 25, 2015 and submitted
The machinery for serializing links has been modified so that its
behvaiour can be changed by subclasses. Theget_link_serializer
method takes a field name and returns the appropriate serializing
function for the link. The default function isserialize_link
but
subclasses may provide aserialize_fieldname_link
method that will be
used instead.
Tested the
serialize_fieldname_link
behaviour with a resource. It
worked as intended.Ran unit tests.
-
-
djblets/webapi/resources.py (Diff revision 1) 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?
Change Summary:
Move serialize function finding into a method.
Description: |
|
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
||||||||||||||||||||||||||||||||||||
Diff: |
Revision 2 (+27 -14) |
-
Tool: PEP8 Style Checker Processed Files: djblets/webapi/resources.py
-
Change Summary:
PEP8
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+27 -14) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+26 -13) |