Добавление работы с конфликтными частями и исправление вайтлиста
This commit is contained in:
@@ -31,11 +31,12 @@ class Base(DeclarativeBase):
|
||||
|
||||
class BanWordType(str, PyEnum):
|
||||
"""Типы банвордов"""
|
||||
SUBSTRING = "substring"
|
||||
WORD = "word"
|
||||
LEMMA = "lemma"
|
||||
PART = "part"
|
||||
CONFLICT_SUBSTRING = "conflict_substring"
|
||||
CONFLICT_WORD = "conflict_word"
|
||||
CONFLICT_LEMMA = "conflict_lemma"
|
||||
CONFLICT_PART = "conflict_part"
|
||||
|
||||
|
||||
class SpamMode(str, PyEnum):
|
||||
@@ -62,7 +63,11 @@ class BanWord(Base):
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
word: Mapped[str] = mapped_column(String(255), nullable=False, index=True)
|
||||
type: Mapped[BanWordType] = mapped_column(
|
||||
Enum(BanWordType, native_enum=False),
|
||||
Enum(
|
||||
BanWordType,
|
||||
native_enum=False,
|
||||
values_callable=lambda enum: [e.value for e in enum]
|
||||
),
|
||||
nullable=False,
|
||||
index=True
|
||||
)
|
||||
@@ -95,8 +100,13 @@ class TempBanWord(Base):
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
word: Mapped[str] = mapped_column(String(255), nullable=False, index=True)
|
||||
type: Mapped[BanWordType] = mapped_column(
|
||||
Enum(BanWordType, native_enum=False),
|
||||
nullable=False
|
||||
Enum(
|
||||
BanWordType,
|
||||
native_enum=False,
|
||||
values_callable=lambda enum: [e.value for e in enum]
|
||||
),
|
||||
nullable=False,
|
||||
index=True
|
||||
)
|
||||
added_by: Mapped[Optional[int]] = mapped_column(Integer, nullable=True)
|
||||
added_at: Mapped[datetime] = mapped_column(
|
||||
|
||||
Reference in New Issue
Block a user