ContentFilter model
This commit is contained in:
parent
e43d7aacf9
commit
1a4f25ec97
18
src/feed.py
18
src/feed.py
@ -355,3 +355,21 @@ class TrackedContent(DjangoDataModel):
|
||||
|
||||
item["creation_datetime"] = datetime.strptime(item["creation_datetime"], "%Y-%m-%dT%H:%M:%S.%f%z")
|
||||
return item
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class ContentFilter(DjangoDataModel):
|
||||
|
||||
id: int
|
||||
name: str
|
||||
matching_algorithm: int
|
||||
match: str
|
||||
is_insensitive: bool
|
||||
is_whitelist: bool
|
||||
guild_id: int
|
||||
|
||||
@staticmethod
|
||||
def parser(item: dict) -> dict:
|
||||
|
||||
item["guild_id"] = int(item["guild_id"]) # stored as str due to a django/sqlite bug, convert back to int
|
||||
return item
|
||||
|
Loading…
x
Reference in New Issue
Block a user