COMPS.Data.TaggableEntity module

class COMPS.Data.TaggableEntity.TaggableEntity[source]

Bases: object

set_tags(tags)[source]

Set the tag key/value pairs associated with this entity.

If the entity has any existing tags, they will be replaced by the tags specified. If this is a new entity, tags will not be updated until the entity is saved, otherwise tags are updated immediately.

Parameters:

tags – A dictionary containing the key/value tag-string pairs to set.

merge_tags(tags)[source]

Merge the given tag key/value pairs with existing tags for this entity.

Any tag keys that already have an existing tag with that key specified for the entity will have their values replaced by the value specified. Any tag keys that don’t already exist for the entity will be added with their specified value.

Parameters:

tags – A dictionary containing the key/value tag-string pairs to merge.

delete_tags(tags)[source]

Delete the given tag keys for this entity.

Parameters:

tags – A dictionary containing the key tag-strings to delete (Note: values are ignored).

class COMPS.Data.TaggableEntity.TagOperationMode(value)[source]

Bases: Enum

An enumeration.

Merge = 1
Replace = 2
Delete = 3