Skip to main content

Bookmark

A saved URL with metadata, tags, and full-text content.

Attributes

AttributeTypeDescription
urlstrThe bookmarked URL.
titlestrHuman-readable title.
descriptionstr = ""Optional longer description.
tagsList[str] = []List of tag IDs associated with this bookmark.
status[BookmarkStatus](bookmarkstatus.md?sid=app_models_bookmark_bookmarkstatus) = BookmarkStatus.ACTIVECurrent visibility status.
idstr = uuid.uuid4().hex[:12]Unique identifier.
created_atdatetime = datetime.utcnow()Timestamp of creation.
updated_atdatetime = datetime.utcnow()Timestamp of last modification.
metadataDict[str, Any] = {}Arbitrary key/value pairs for extensibility.

Methods


archive()

def archive(self) -> None: ...

Move the bookmark to the archive.

Returns

TypeDescription
None

trash()

def trash(self) -> None: ...

Soft-delete the bookmark by moving it to the trash.

Returns

TypeDescription
None

restore()

def restore(self) -> None: ...

Restore a trashed or archived bookmark to active status.

Returns

TypeDescription
None

add_tag()

def add_tag(self, tag_id: str) -> bool: ...

Attach a tag. Returns False if already present.

Parameters

NameTypeDescription
tag_idstrThe unique identifier of the tag to attach.

Returns

TypeDescription
bool

remove_tag()

def remove_tag(self, tag_id: str) -> bool: ...

Detach a tag. Returns False if not found.

Parameters

NameTypeDescription
tag_idstrThe unique identifier of the tag to detach.

Returns

TypeDescription
bool

to_dict()

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

Serialise to a plain dictionary for JSON responses.

Returns

TypeDescription
Dict[str, Any]

from_dict()

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

Construct a Bookmark from a dictionary (e.g. JSON body).

Parameters

NameTypeDescription
dataDict[str, Any]Dictionary with bookmark fields.

Returns

TypeDescription
"Bookmark"A new Bookmark instance.