Bookmark
A saved URL with metadata, tags, and full-text content.
Attributes
| Attribute | Type | Description |
|---|---|---|
| url | str | The bookmarked URL. |
| title | str | Human-readable title. |
| description | str = "" | Optional longer description. |
| tags | List[str] = [] | List of tag IDs associated with this bookmark. |
| status | [BookmarkStatus](bookmarkstatus.md?sid=app_models_bookmark_bookmarkstatus) = BookmarkStatus.ACTIVE | Current visibility status. |
| id | str = uuid.uuid4().hex[:12] | Unique identifier. |
| created_at | datetime = datetime.utcnow() | Timestamp of creation. |
| updated_at | datetime = datetime.utcnow() | Timestamp of last modification. |
| metadata | Dict[str, Any] = {} | Arbitrary key/value pairs for extensibility. |
Methods
archive()
def archive(self) -> None: ...
Move the bookmark to the archive.
Returns
| Type | Description |
|---|---|
None |
trash()
def trash(self) -> None: ...
Soft-delete the bookmark by moving it to the trash.
Returns
| Type | Description |
|---|---|
None |
restore()
def restore(self) -> None: ...
Restore a trashed or archived bookmark to active status.
Returns
| Type | Description |
|---|---|
None |
add_tag()
def add_tag(self, tag_id: str) -> bool: ...
Attach a tag. Returns False if already present.
Parameters
| Name | Type | Description |
|---|---|---|
| tag_id | str | The unique identifier of the tag to attach. |
Returns
| Type | Description |
|---|---|
bool |
remove_tag()
def remove_tag(self, tag_id: str) -> bool: ...
Detach a tag. Returns False if not found.
Parameters
| Name | Type | Description |
|---|---|---|
| tag_id | str | The unique identifier of the tag to detach. |
Returns
| Type | Description |
|---|---|
bool |
to_dict()
def to_dict(self) -> Dict[str, Any]: ...
Serialise to a plain dictionary for JSON responses.
Returns
| Type | Description |
|---|---|
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
| Name | Type | Description |
|---|---|---|
| data | Dict[str, Any] | Dictionary with bookmark fields. |
Returns
| Type | Description |
|---|---|
"Bookmark" | A new Bookmark instance. |