async-easy-model 0.1.12__py3-none-any.whl → 0.2.1__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.
- async_easy_model/auto_relationships.py +12 -0
- async_easy_model/model.py +635 -84
- async_easy_model-0.2.1.dist-info/METADATA +343 -0
- async_easy_model-0.2.1.dist-info/RECORD +10 -0
- async_easy_model-0.1.12.dist-info/METADATA +0 -533
- async_easy_model-0.1.12.dist-info/RECORD +0 -10
- {async_easy_model-0.1.12.dist-info → async_easy_model-0.2.1.dist-info}/LICENSE +0 -0
- {async_easy_model-0.1.12.dist-info → async_easy_model-0.2.1.dist-info}/WHEEL +0 -0
- {async_easy_model-0.1.12.dist-info → async_easy_model-0.2.1.dist-info}/top_level.txt +0 -0
@@ -22,8 +22,20 @@ _auto_processed_models = set()
|
|
22
22
|
_auto_relationships_processed = False
|
23
23
|
|
24
24
|
# Flag to enable/disable automatic relationship detection
|
25
|
+
# Disabled by default and will be enabled during init_db
|
25
26
|
_auto_relationships_enabled = False
|
26
27
|
|
28
|
+
# Automatically disable auto-relationships at module import time
|
29
|
+
# This ensures models can be defined without immediate processing
|
30
|
+
def _disable_auto_relationships_on_import():
|
31
|
+
# This will be automatically called when the module is imported
|
32
|
+
global _auto_relationships_enabled
|
33
|
+
_auto_relationships_enabled = False
|
34
|
+
logger.info("Auto relationships disabled by default at import")
|
35
|
+
|
36
|
+
# Call the function immediately when this module is imported
|
37
|
+
_disable_auto_relationships_on_import()
|
38
|
+
|
27
39
|
def pluralize_name(name: str) -> str:
|
28
40
|
"""Convert a singular noun to its plural form."""
|
29
41
|
# Check if the name already ends with 's'
|