Sets
Related to the Sets API
- class koordinates.sets.SetManager(client)
Bases:
Manager
Accessor for querying Sets.
Access via the
sets
property of akoordinates.client.Client
instance.- create(set)
Creates a new Set.
- create_draft(set_id)
Creates a new draft version.
- Return type:
- Returns:
the new version
- Raises:
409 Conflict – if there is already a draft version for this set.
- expand(*args, **kwargs)
Returns an expanded Query view of the model objects. Equivalent to calling
.list().expand()
. Using expansions may have significant performance implications for some API requests. Seekoordinates.base.Query.expand()
.
- filter(*args, **kwargs)
Returns a filtered Query view of the model objects. Equivalent to calling
.list().filter(...)
. Seekoordinates.base.Query.filter()
.
- get(id, expand=[])
Fetches a Model instance determined by the value of id.
- Parameters:
id – numeric ID for the Model.
- get_draft(set_id, expand=[])
Get the current draft version of a set. :raises NotFound: if there is no draft version.
- get_published(set_id, expand=[])
Get the latest published version of this set. :raises NotFound: if there is no published version.
- get_version(set_id, version_id, expand=[])
Get a specific version of a set.
- list()
Fetches a set of model objects
- Return type:
koordinates.base.Query
- list_drafts()
A filterable list view of sets, returning the draft version of each set. If the most recent version has been published already, it won’t be returned here.
- list_versions(set_id)
Filterable list of versions of a set, always ordered newest to oldest.
If the version’s source supports revisions, you can get a specific revision using
.filter(data__source_revision=value)
. Specific values depend on the source type. Usedata__source_revision__lt
ordata__source_revision__gte
to filter using<
or>=
operators respectively.
- order_by(*args, **kwargs)
Returns an ordered Query view of the model objects. Equivalent to calling
.list().order_by(...)
. Seekoordinates.base.Query.order_by()
.
- set_metadata(set_id, fp)
Set the XML metadata on a set.
- Parameters:
fp (file) – file-like object to read the XML metadata from.
- class koordinates.sets.Set(**kwargs)
Bases:
Model
,PermissionObjectMixin
Represents a single set grouping of layers, tables, and documents.
- delete_version(version_id=None)
Deletes this draft version (revert to published)
- Raises:
NotAllowed – if this version is already published.
Conflict – if this version is already deleted.
- get_draft_version(expand=())
Get the current draft version of this set. :raises NotFound: if there is no draft version.
- get_published_version(expand=())
Get the latest published version of this set. :raises NotFound: if there is no published version.
- get_version(version_id, expand=())
Get a specific version of this set
- property is_draft_version
Return if this version is the draft version of a layer
- property is_published_version
Return if this version is the published version of a layer
- list_versions()
Filterable list of versions of a set, always ordered newest to oldest.
If the version’s source supports revisions, you can get a specific revision using
.filter(data__source_revision=value)
. Specific values depend on the source type. Usedata__source_revision__lt
ordata__source_revision__gte
to filter using<
or>=
operators respectively.
- publish(version_id=None)
Creates a publish task for this version.
- refresh()
Refresh this model from the server.
Updates attributes with the server-defined values. This is useful where the Model instance came from a partial response (eg. a list query) and additional details are required.
Existing attribute values will be overwritten.
- save()
Edits this draft version.
- Raises:
NotAllowed – if the version is already published.
- set_metadata(fp, version_id=None)
Set the XML metadata on this draft version.
- Parameters:
fp (file) – file-like object to read the XML metadata from.
- Raises:
NotAllowed – if this version is already published.
- class koordinates.sets.SetVersion(**kwargs)
Bases:
InnerModel
Represents the
version
property of akoordinates.client.Client
instance.
- class koordinates.sets.SetVersionManager(client, parent_manager)
Bases:
InnerManager
- model
alias of
SetVersion
- class koordinates.sets.SetDataManager(client, parent_manager)
Bases:
InnerManager
- class koordinates.sets.SetData(**kwargs)
Bases:
InnerModel
Represents the
data
property of akoordinates.client.Client
instance.