mirror of https://gitlab.com/tildes/tildes.git
Browse Source
Merge branch 'upgrade-marshmallow-4.0' into 'develop-1.101'
Merge branch 'upgrade-marshmallow-4.0' into 'develop-1.101'
Draft: Upgrade Marshmallow to 4.0 See merge request tildes/tildes!171merge-requests/171/merge
25 changed files with 180 additions and 88 deletions
-
4tildes/requirements-dev.txt
-
4tildes/requirements.in
-
4tildes/requirements.txt
-
6tildes/tildes/json.py
-
4tildes/tildes/resources/group.py
-
2tildes/tildes/schemas/comment.py
-
30tildes/tildes/schemas/context.py
-
25tildes/tildes/schemas/fields.py
-
17tildes/tildes/schemas/group.py
-
27tildes/tildes/schemas/listing.py
-
24tildes/tildes/schemas/topic.py
-
29tildes/tildes/schemas/user.py
-
2tildes/tildes/views/api/web/comment.py
-
2tildes/tildes/views/api/web/group.py
-
3tildes/tildes/views/api/web/topic.py
-
8tildes/tildes/views/api/web/user.py
-
2tildes/tildes/views/bookmarks.py
-
28tildes/tildes/views/decorators.py
-
13tildes/tildes/views/login.py
-
2tildes/tildes/views/message.py
-
8tildes/tildes/views/register.py
-
6tildes/tildes/views/settings.py
-
8tildes/tildes/views/topic.py
-
8tildes/tildes/views/user.py
-
2tildes/tildes/views/votes.py
@ -0,0 +1,30 @@ |
|||
# Copyright (c) 2018 Tildes contributors <code@tildes.net> |
|||
# SPDX-License-Identifier: AGPL-3.0-or-later |
|||
|
|||
"""Context variables that can be used with Marshmallow schemas.""" |
|||
import typing |
|||
|
|||
from marshmallow.experimental.context import Context |
|||
|
|||
|
|||
class TildesContext(typing.TypedDict, total=False): |
|||
"""Context for Tildes Marshmallow schemas. |
|||
|
|||
For convenience, we use one unified class instead of one per schema, |
|||
so it can be passed down through different schemas in a subgraph. |
|||
For example, if a Topic contains a reference to a User, |
|||
one instance of TildesContext can configure both the Topic and User. |
|||
""" |
|||
|
|||
# Applies to UserSchema |
|||
hide_username: bool |
|||
# Applies to UserSchema |
|||
check_breached_passwords: bool |
|||
# Applies to UserSchema |
|||
username_trim_whitespace: bool |
|||
|
|||
# Applies to GroupSchema |
|||
fix_path_capitalization: bool |
|||
|
|||
|
|||
TildesSchemaContext = Context[TildesContext] |
Write
Preview
Loading…
Cancel
Save
Reference in new issue