syncano.models.archetypes

class ModelMetaclass[source]

Bases: type

Metaclass for all models.

add_to_class(name, value)[source]
create_error_class()[source]
build_doc(name, meta)[source]

Give the class a docstring if it’s not defined.

class Model(**kwargs)[source]

Bases: object

Base class for all models.

save(**kwargs)[source]

Creates or updates the current instance. Override this in a subclass if you want to control the saving process.

classmethod batch_object(method, path, body, properties=None)[source]
mark_for_batch()[source]
delete(**kwargs)[source]

Removes the current instance.

reload(**kwargs)[source]

Reloads the current instance.

validate()[source]

Validates the current instance.

Raises:SyncanoValidationError, SyncanoFieldError
is_valid()[source]
is_new()[source]
to_python(data)[source]

Converts raw data to python types and built-in objects.

Parameters:data (dict) – Raw data
to_native()[source]

Converts the current instance to raw data which can be serialized to JSON and send to API.

get_endpoint_data()[source]