Skip to main content

Tag

A label that can be attached to one or more bookmarks.

Attributes

AttributeTypeDescription
namestrDisplay name (must be unique per user).
color[TagColor](tagcolor.md?sid=app_models_tag_tagcolor) = TagColor.GRAYVisual colour for UI rendering.
descriptionstr = ""Optional description of what this tag represents.
idstrUnique identifier.
usage_countint = 0Number of bookmarks currently using this tag.

Methods


rename()

def rename(self, new_name: str) -> None: ...

Rename the tag.

Parameters

NameTypeDescription
new_namestrThe new display name.

Returns

TypeDescription
None

increment_usage()

def increment_usage(self) -> int: ...

Record that a bookmark now uses this tag. Returns new count.

Returns

TypeDescription
int

decrement_usage()

def decrement_usage(self) -> int: ...

Record that a bookmark removed this tag. Returns new count.

Returns

TypeDescription
int

to_dict()

def to_dict(self) -> Dict[str, Any]: ...

Serialise to a JSON-safe dictionary.

Returns

TypeDescription
Dict[str, Any]

from_dict()

@classmethod
def from_dict(cls, data: Dict[str, Any]) -> "Tag": ...

Construct a Tag from a dictionary.

Parameters

NameTypeDescription
dataDict[str, Any]The dictionary containing tag data.

Returns

TypeDescription
[Tag](tag.md?sid=app_models_tag_tag)