Skip to main content

Model

Base class for all Datagrok models. This class provides basic functionality for all model classes in the Datagrok API. It handles unique identification of model instances and ensures each instance has a valid ID.

Attributes

NameTypeDescription
idstrUnique identifier for the model instance. Can be None for new instances that haven't been saved to the server yet.

Methods

__init__()

ensure_id()

Ensure the model has a valid ID, generating one if necessary. If the model's ID is None, generates a new UUID v1 and assigns it to the model. This is typically used before saving a new model instance to the server.

Returns

TypeDescription
strThe model's ID (either existing or newly generated)