models.representations.BaseRepresentation¶
Note
This module contains the implemented representation classes for all property representations that may be added to KE-chain.
- class BaseRepresentation(obj=None, json=None, value=None, prop=None)[source]¶
Base class for all Representations.
- Variables:
jsonschema – jsonschema to validate the json of the representation
rtype – type of representation
Construct a base representation.
- Parameters:
- validate_json() Any [source]¶
Validate the json representation of the validator against the validator jsonschema.
- classmethod parse(obj: Any, json: Dict) BaseRepresentation [source]¶
Parse a json dict and return the correct subclass of
BaseRepresentation
.It uses the ‘rtype’ key to determine which
BaseRepresentation
to instantiate.- Parameters:
obj – object to which the BaseRepresentation belongs.
json (dict) – dictionary containing the specific keys to parse into a
BaseRepresentation
- Type:
prop: Base
- Returns:
the instantiated subclass of
BaseRepresentation
- Return type:
BaseRepresentation
or subclass thereof
- property value¶
Retrieve current representation value.
- Returns:
value
:rtype Any
- class RepresentationsComponent(parent_object, representation_options: Dict, update_method: Callable)[source]¶
Aggregate class to use representations on an object.
To add representations to a Pykechain class, create an instance of this class in its __init__() method.
New in version 3.7.
Extract the json with the representation options.
- Parameters:
parent_object – Object to which this representation component is attached
representation_options – json with list of representations
update_method – method of the parent_object that is used to update the representations
- class DecimalPlaces(obj=None, json=None, value=None, prop=None)[source]¶
Representation for floating-point value properties.
Construct a base representation.
- Parameters:
- class SignificantDigits(obj=None, json=None, value=None, prop=None)[source]¶
Representation for floating-point value properties.
Construct a base representation.
- Parameters:
- class LinkTarget(obj=None, json=None, value=None, prop=None)[source]¶
Representation for HTML link reference properties.
Construct a base representation.
- Parameters:
- validate_representation(value: LinkTargets) None [source]¶
Validate whether the representation value can be set.
- Parameters:
value (LinkTargets) – representation value to set.
- Returns:
None
- class ButtonRepresentation(obj=None, json=None, value=None, prop=None)[source]¶
Representation for single-select list properties.
Construct a base representation.
- Parameters:
- validate_representation(value: SelectListRepresentations) None [source]¶
Validate whether the representation value can be set.
- Parameters:
value (SelectListRepresentations) – representation value to set.
- Returns:
None
- class Autofill(obj=None, json=None, value=None, prop=None)[source]¶
Representation for date(time) properties.
Construct a base representation.
- Parameters:
- class CustomIconRepresentation(*args, **kwargs)[source]¶
Representation for scope and activities to display a custom Font Awesome icon.
Create a custom icon representation.
Display mode of the icon will be regular by default.
- validate_representation(value: str)[source]¶
Validate whether the representation value can be set.
- Parameters:
value (str) – representation value to set.
- Returns:
None
- property display_mode¶
Get the the display mode of the custom icon representation.
- class GeoCoordinateRepresentation(obj=None, json=None, value=None, prop=None)[source]¶
Representation for Geocoordinate properties.
It should look like this in the value_options # “representations”: [ # { # “rtype”: “geoCoordinate”, # “config”: { # “geoCoordinate”: “rd_amersfoort” # can be any of GeoCoordinateConfig # } # } # ] # },
Construct a base representation.
- Parameters:
- validate_representation(value: GeoCoordinateConfig) None [source]¶
Validate whether the representation value can be set.
- Parameters:
value (one of GeoCoordinateConfig) – representation value to set.
- Returns:
None
- class UsePropertyNameRepresentation(obj=None, json=None, value=None, prop=None)[source]¶
Representation for the use of Property Names in a reference property.
Construct a base representation.
- Parameters: