Skip to content

Commit 11ee30c

Browse files
committed
Move tags to BaseContent
1 parent f6498f4 commit 11ee30c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

aleph_message/models/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,6 @@ class BaseMessage(BaseModel):
216216
)
217217
item_hash: ItemHash = Field(description="Hash of the content (sha256 by default)")
218218
content: BaseContent = Field(description="Content of the message, ready to be used")
219-
tags: Optional[List[str]] = Field(
220-
default=None, description="Tags associated with the message"
221-
)
222219

223220
forgotten_by: Optional[List[str]]
224221

aleph_message/models/abstract.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from pydantic import BaseModel, Extra
1+
from typing import List, Optional
2+
3+
from pydantic import BaseModel, Extra, Field
24

35

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

2426
address: str
2527
time: float
28+
tags: Optional[List[str]] = Field(
29+
default=None, description="Tags associated with the message"
30+
)
2631

2732
class Config:
2833
extra = Extra.forbid

0 commit comments

Comments
 (0)