aito.schema.AitoColumnLinkSchema
- class aito.schema.AitoColumnLinkSchema(table_name: str, column_name: str)
Bases:
AitoSchemaLink to a column of another table
- Parameters:
table_name (str) – the name of the linked table
column_name (str) – the name of the linked column
Methods
create a class object from a JSON deserialized object
from_json_string(json_string, **kwargs)create an class object from a JSON string
the JSON schema of the class
json_schema_validate(obj)Validate an object with the class json_schema Returns the object if validation success, else raise
JsonValidationErrorjson_schema_validate_with_schema(obj, schema)Validate an object with the given schema
convert the object to an object that can be serialized to a JSON formatted string
to_json_string(**kwargs)convert the object to a JSON string
Attributes
column_link_patternthe name of the linked column
column_name_patternproperties of the schema object that will be used for comparison operation
the name of the linked table
table_name_patternthe type of the schema component
uuid_pattern- property column_name: str
the name of the linked column
- Return type:
str
- property comparison_properties: Iterable[str]
properties of the schema object that will be used for comparison operation
- Return type:
Iterable[str]
- classmethod from_deserialized_object(obj: str) AitoColumnLinkSchema
create a class object from a JSON deserialized object
- classmethod from_json_string(json_string: str, **kwargs)
create an class object from a JSON string
- Parameters:
json_string (str) – the JSON string
kwargs – the keyword arguments for json.loads method
- classmethod json_schema()
the JSON schema of the class
- Return type:
Dict
- classmethod json_schema_validate(obj: Any)
Validate an object with the class json_schema Returns the object if validation success, else raise
JsonValidationError- Parameters:
obj (Any) – the object to be validated
- Returns:
the object if validation succeed
- Return type:
Any
- json_schema_validate_with_schema(obj: Any, schema: Dict)
Validate an object with the given schema
- Parameters:
obj (Any) – the object to be validated
schema (Dict) – the schema to be validate against
- Returns:
the object if validation succeed
- Return type:
Any
- property table_name: str
the name of the linked table
- Return type:
str
- to_json_serializable()
convert the object to an object that can be serialized to a JSON formatted string
- to_json_string(**kwargs)
convert the object to a JSON string
- Parameters:
kwargs – the keyword arguments for json.dumps method
- Return type:
str
- property type
the type of the schema component
- Return type:
str