cardo-python-utils 0.5.dev36__py3-none-any.whl → 0.5.dev37__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cardo-python-utils
3
- Version: 0.5.dev36
3
+ Version: 0.5.dev37
4
4
  Summary: Python library enhanced with a wide range of functions for different scenarios.
5
5
  Author-email: CardoAI <hello@cardoai.com>
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
- cardo_python_utils-0.5.dev36.dist-info/licenses/LICENSE,sha256=N-YtxDy8n5A1Mo7JKKItNIlboiK_pMOZ48ojx76jo3g,1046
1
+ cardo_python_utils-0.5.dev37.dist-info/licenses/LICENSE,sha256=N-YtxDy8n5A1Mo7JKKItNIlboiK_pMOZ48ojx76jo3g,1046
2
2
  python_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  python_utils/choices.py,sha256=_sLNkSnQqhg55gGKNRsOQCJ75W6gnz8J8Q00528MEYk,2548
4
4
  python_utils/data_structures.py,sha256=ZqkZYPy20zyGYOVhwb9qst4vF_P7X2A9z5E36rMUC6I,16820
@@ -11,7 +11,7 @@ python_utils/math.py,sha256=p_v8a9nVSe9426nR8H_SM8hOQrkzESVpCnn3gntw7TA,5603
11
11
  python_utils/text.py,sha256=pw9CZeM_Lcw-6k4GyR-4D1Wix8A7F_V1u1IIZTIazW4,3792
12
12
  python_utils/time.py,sha256=7Wei3uJ02Bk-BFRf-e1axoG418XQOhrXPvTwNZgTdnw,9614
13
13
  python_utils/types_hinting.py,sha256=QVWzmXRgNxhvln14tEX_FbQYryuVYhjWJ0dVOnlF6G4,120
14
- python_utils/django/README.md,sha256=rOU6nNKs_RIHRUBri49mWlAAGmj9k2368wzPT5hrJkE,5661
14
+ python_utils/django/README.md,sha256=01QcXWGfWcVaI2fFxcC2twYOabTCmTwh-OyyKPtcOdM,6027
15
15
  python_utils/django/__init__.py,sha256=uXyqF-_5gZAlSIKoQkUTedAeBjnUHqh6lR6SzA1DEOM,64
16
16
  python_utils/django/apps.py,sha256=rgGdSsvptNVQ5QOEfYTdX7eA9EBgEPqq3LKIBLxaFLo,103
17
17
  python_utils/django/oidc_settings.py,sha256=Moc3ZEOIb40sCcvJtl4Xo51SjC__9Ki85sRhFuoX9dg,3926
@@ -47,8 +47,8 @@ python_utils/django/redis/key_function.py,sha256=FkpRvg4Q7td8xZxYHPyo3lthXLzorD6
47
47
  python_utils/django/storage/__init__.py,sha256=mNn2YmD7pkXhBLHMM1444BLsCMq78YdYxL3BsP9Cjfc,161
48
48
  python_utils/django/storage/tenant_aware_storage.py,sha256=5dDes6xLv7_R8hIBbFIzRvPL7HL9K_RM-G6LI8qUSxM,2550
49
49
  python_utils/django/tests/__init__.py,sha256=Nkt0a7LEHyjLvuEBZ7113VjjAWJlyZlMy-H-JZ5tNcs,252
50
- python_utils/django/tests/conftest.py,sha256=PTA2QAqOMtmeVE87C1FOTC2d_4FSRw_i1vMgLoxKkwA,3176
51
- cardo_python_utils-0.5.dev36.dist-info/METADATA,sha256=NwNwVxCURk3axAM2NhhqsACqo_No7R6PTulAgCaqxg0,3007
52
- cardo_python_utils-0.5.dev36.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
53
- cardo_python_utils-0.5.dev36.dist-info/top_level.txt,sha256=zAx6OfEsjJs8BEW3okSiG_j9gpkI69xWShzum6oBgKI,13
54
- cardo_python_utils-0.5.dev36.dist-info/RECORD,,
50
+ python_utils/django/tests/conftest.py,sha256=KozXmXUWVcDLbkVAb7Aq4sDydGLh2YZkbRa4tkA8Z6U,3167
51
+ cardo_python_utils-0.5.dev37.dist-info/METADATA,sha256=y3s_Rq-d1tZ2Ub3tRzlA7coR2zgGqPkL3EjwU4DWJtM,3007
52
+ cardo_python_utils-0.5.dev37.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
53
+ cardo_python_utils-0.5.dev37.dist-info/top_level.txt,sha256=zAx6OfEsjJs8BEW3okSiG_j9gpkI69xWShzum6oBgKI,13
54
+ cardo_python_utils-0.5.dev37.dist-info/RECORD,,
@@ -35,11 +35,17 @@ MIDDLEWARE = [
35
35
 
36
36
  # Include the database configuration for each tenant in the DATABASES setting.
37
37
  # You can use the get_database_configs() function from python_utils.django.db.utils as a helper.
38
- DATABASES = {
39
- 'tenant1': { ... },
40
- 'tenant2': { ... },
41
- ...
42
- }
38
+ from python_utils.django.db.utils import get_database_configs
39
+
40
+ for tenant, tenant_db_config in get_database_configs().items():
41
+ DATABASES[tenant] = {
42
+ "ENGINE": "django.db.backends.postgresql",
43
+ "NAME": tenant_db_config["name"],
44
+ "USER": tenant_db_config["user"],
45
+ "PASSWORD": tenant_db_config["password"],
46
+ "HOST": tenant_db_config["host"],
47
+ "PORT": tenant_db_config.get("port", 5432),
48
+ }
43
49
 
44
50
  # If you want to override the database alias to use for local development (when DEBUG is True).
45
51
  # By default, the first database defined in DATABASES is used.
@@ -80,7 +80,7 @@ def mock_verify_scopes_ninja():
80
80
  Patches AuthBearer._verify_scopes, so that no real scope checking is done during tests.
81
81
  This is done because scope checking uses route resolution, which the test client does not support.
82
82
  """
83
- with patch("python_utils.keycloak.django.api.ninja.AuthBearer._verify_scopes") as mock_verify:
83
+ with patch("python_utils.django.api.ninja.AuthBearer._verify_scopes") as mock_verify:
84
84
  mock_verify.return_value = None
85
85
  yield mock_verify
86
86