Projection¶
- class Projection[source]¶
Bases:
object
Marker base class for all projections.
Projections allow the client to transform (strip down) each query result object in order to avoid redundant network traffic.
- single_attribute(attribute_path)[source]¶
Creates a projection that extracts the value of the given attribute path.
- Parameters
attribute_path (str) – Path to extract the attribute from.
- Returns
A projection that extracts the value of the given attribute path.
- Return type
Projection[any]
- multi_attribute(*attribute_paths)[source]¶
Creates a projection that extracts the values of one or more attribute paths.
- Parameters
*attribute_paths (str) – Paths to extract the attributes from.
- Returns
A projection that extracts the values of the given attribute paths.
- Return type
Projection[list]