diff options
author | 2022-03-03 20:21:42 +0200 | |
---|---|---|
committer | 2022-07-16 02:29:27 +0300 | |
commit | ddf0839661fa3863b82e6c68dfaa92103d05a252 (patch) | |
tree | cf570a129f2da2f3ce3e13f6a1143ab3ad152dd7 /tests | |
parent | Add domain filtering (diff) |
Add filter-type-specific settings
Pydantic is added to the bot's dependencies, allowing easily setting up settings that are specific to a filter type (e.g for domains).
The data for those settings is loaded from the "additional_field" JSON field in the Filter table.
This commit specifically adds an option to match a domain exactly, without matching subdomains.
There are several benefits to using Pydantic:
- Built-in serialization to, and de-serialization from JSON, which is useful for reading and writing to the DB.
- Type validation on initialization.
- By default ignores extra fields when de-serializing, which can prevent things breaking if the extra fields change.
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions