Skip to content

Commit

Permalink
Move tags to BaseContent
Browse files Browse the repository at this point in the history
  • Loading branch information
MHHukiewitz committed Dec 15, 2023
1 parent f6498f4 commit 11ee30c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 0 additions & 3 deletions aleph_message/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@ class BaseMessage(BaseModel):
)
item_hash: ItemHash = Field(description="Hash of the content (sha256 by default)")
content: BaseContent = Field(description="Content of the message, ready to be used")
tags: Optional[List[str]] = Field(
default=None, description="Tags associated with the message"
)

forgotten_by: Optional[List[str]]

Expand Down
7 changes: 6 additions & 1 deletion aleph_message/models/abstract.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from pydantic import BaseModel, Extra
from typing import List, Optional

from pydantic import BaseModel, Extra, Field


def hashable(obj):
Expand All @@ -23,6 +25,9 @@ class BaseContent(BaseModel):

address: str
time: float
tags: Optional[List[str]] = Field(
default=None, description="Tags associated with the message"
)

class Config:
extra = Extra.forbid

0 comments on commit 11ee30c

Please sign in to comment.