fastapi-mongo-base 1.2.0__tar.gz → 1.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fastapi_mongo_base-1.2.0/src/fastapi_mongo_base.egg-info → fastapi_mongo_base-1.2.1}/PKG-INFO +1 -1
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/pyproject.toml +1 -1
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/__pycache__/__init__.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/__pycache__/models.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/__pycache__/routes.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/__pycache__/schemas.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/__pycache__/tasks.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/__pycache__/__init__.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/__pycache__/app_factory.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/__pycache__/config.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/__pycache__/db.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/__pycache__/exceptions.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/errors/i18n.py +10 -10
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/__pycache__/basic.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/__pycache__/bsontools.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/__pycache__/timezone.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1/src/fastapi_mongo_base.egg-info}/PKG-INFO +1 -1
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/__pycache__/__init__.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/__pycache__/conftest.cpython-312-pytest-9.1.1.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/__pycache__/test_apis.cpython-312-pytest-9.1.1.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/__pycache__/test_app.cpython-312-pytest-9.1.1.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/__pycache__/test_db_init.cpython-312-pytest-9.1.1.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/__pycache__/test_i18n_errors.cpython-312-pytest-9.1.1.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/__pycache__/test_mongo_exceptions.cpython-312-pytest-9.1.1.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/__pycache__/test_resource_exceptions.cpython-312-pytest-9.1.1.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/app/__pycache__/__init__.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/app/__pycache__/server.cpython-312.pyc +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/test_i18n_errors.py +5 -4
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/LICENSE.txt +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/MANIFEST.in +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/README.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/boilerplate.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/changelog.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/contributing.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/endpoints.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/extra.css +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/index.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/installation.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/license.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/quickstart.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/settings.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/tutorial.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/docs/usage.md +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/mkdocs.yml +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/pytest.ini +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/setup.cfg +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/__init__.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/__init__.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/app_factory.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/config.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/db.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/enums.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/errors/db_errors.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/errors/resource_errors.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/exceptions.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/models.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/py.typed +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/routes.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/schemas.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/sql.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/tasks.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/__init__.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/basic.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/bsontools.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/timezone.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/usso_routes.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base.egg-info/SOURCES.txt +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base.egg-info/dependency_links.txt +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base.egg-info/requires.txt +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base.egg-info/top_level.txt +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/__init__.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/app/__init__.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/app/logs/app.log +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/app/main.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/app/server.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/conftest.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/test_apis.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/test_app.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/test_db_init.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/test_mongo_exceptions.py +0 -0
- {fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/test_resource_exceptions.py +0 -0
{fastapi_mongo_base-1.2.0/src/fastapi_mongo_base.egg-info → fastapi_mongo_base-1.2.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-mongo-base
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: A simple boilerplate application, including models and schemas and abstract router, for FastAPI with MongoDB
|
|
5
5
|
Author-email: Mahdi Kiani <mahdikiany@gmail.com>
|
|
6
6
|
Maintainer-email: Mahdi Kiani <mahdikiany@gmail.com>
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "fastapi-mongo-base"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.1"
|
|
8
8
|
description = "A simple boilerplate application, including models and schemas and abstract router, for FastAPI with MongoDB"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/errors/i18n.py
RENAMED
|
@@ -11,15 +11,12 @@ FALLBACK_LOCALE = "en"
|
|
|
11
11
|
|
|
12
12
|
def build_messages(en: str, fa: str | None = None) -> dict[str, str]:
|
|
13
13
|
"""
|
|
14
|
-
Build a language map with English and
|
|
14
|
+
Build a bilingual language map with English and Persian text.
|
|
15
15
|
|
|
16
|
-
Always includes ``en``
|
|
17
|
-
|
|
16
|
+
Always includes both ``en`` and ``fa``. When Persian text is omitted,
|
|
17
|
+
``fa`` falls back to the English string.
|
|
18
18
|
"""
|
|
19
|
-
|
|
20
|
-
if fa:
|
|
21
|
-
messages["fa"] = fa
|
|
22
|
-
return messages
|
|
19
|
+
return {"en": en, "fa": fa if fa is not None else en}
|
|
23
20
|
|
|
24
21
|
|
|
25
22
|
def normalize_messages(
|
|
@@ -32,9 +29,12 @@ def normalize_messages(
|
|
|
32
29
|
return build_messages(fallback)
|
|
33
30
|
if isinstance(value, str):
|
|
34
31
|
return build_messages(value)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
messages = dict(value)
|
|
33
|
+
if "en" not in messages and fallback:
|
|
34
|
+
messages["en"] = fallback
|
|
35
|
+
if "fa" not in messages and "en" in messages:
|
|
36
|
+
messages["fa"] = messages["en"]
|
|
37
|
+
return messages
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
def resolve_locale(request: Request | None) -> str:
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1/src/fastapi_mongo_base.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-mongo-base
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: A simple boilerplate application, including models and schemas and abstract router, for FastAPI with MongoDB
|
|
5
5
|
Author-email: Mahdi Kiani <mahdikiany@gmail.com>
|
|
6
6
|
Maintainer-email: Mahdi Kiani <mahdikiany@gmail.com>
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/__pycache__/__init__.cpython-312.pyc
RENAMED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/app/__pycache__/__init__.cpython-312.pyc
RENAMED
|
Binary file
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/tests/app/__pycache__/server.cpython-312.pyc
RENAMED
|
Binary file
|
|
@@ -23,9 +23,9 @@ from fastapi_mongo_base.core.exceptions import (
|
|
|
23
23
|
)
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
def
|
|
27
|
-
"""Build messages always includes en."""
|
|
28
|
-
assert build_messages("Hello") == {"en": "Hello"}
|
|
26
|
+
def test_build_messages_always_includes_en_and_fa() -> None:
|
|
27
|
+
"""Build messages always includes en and fa."""
|
|
28
|
+
assert build_messages("Hello") == {"en": "Hello", "fa": "Hello"}
|
|
29
29
|
assert build_messages("Hello", "سلام") == {"en": "Hello", "fa": "سلام"}
|
|
30
30
|
|
|
31
31
|
|
|
@@ -33,6 +33,7 @@ def test_normalize_messages_backward_compatible_string() -> None:
|
|
|
33
33
|
"""Normalize messages backward compatible string."""
|
|
34
34
|
assert normalize_messages("Legacy text", fallback="fb") == {
|
|
35
35
|
"en": "Legacy text",
|
|
36
|
+
"fa": "Legacy text",
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
|
|
@@ -77,7 +78,7 @@ def test_base_http_exception_legacy_error_messages_string() -> None:
|
|
|
77
78
|
"""Base http exception legacy error messages string."""
|
|
78
79
|
error_messages["legacy_code"] = "Legacy English"
|
|
79
80
|
exc = BaseHTTPException(status_code=400, error="legacy_code")
|
|
80
|
-
assert exc.message == {"en": "Legacy English"}
|
|
81
|
+
assert exc.message == {"en": "Legacy English", "fa": "Legacy English"}
|
|
81
82
|
assert exc.detail == "Legacy English"
|
|
82
83
|
error_messages.pop("legacy_code")
|
|
83
84
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/__init__.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/app_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/core/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/bsontools.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/timezone.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base/utils/usso_routes.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base.egg-info/requires.txt
RENAMED
|
File without changes
|
{fastapi_mongo_base-1.2.0 → fastapi_mongo_base-1.2.1}/src/fastapi_mongo_base.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|