@@ -60,37 +60,37 @@ def get_model(self, model_name, require_ready=True):
60
60
61
61
return obj .get_model ()
62
62
63
- def get_models (self , include_auto_created = False , include_swapped = False ):
64
- """Return all models for this plugin, including custom object type models."""
65
- # Get the regular Django models first
66
- for model in super ().get_models (include_auto_created , include_swapped ):
67
- yield model
68
-
69
- # Skip custom object type model loading if running during migration
70
- if is_running_migration ():
71
- return
72
-
73
- # Suppress warnings about database calls during model loading
74
- with warnings .catch_warnings ():
75
- warnings .filterwarnings (
76
- "ignore" , category = RuntimeWarning , message = ".*database.*"
77
- )
78
- warnings .filterwarnings (
79
- "ignore" , category = UserWarning , message = ".*database.*"
80
- )
81
-
82
- # Add custom object type models
83
- from .models import CustomObjectType
84
-
85
- # Only load models that are already cached to avoid creating all models at startup
86
- # This prevents the "two TaggableManagers with same through model" error
87
- custom_object_types = CustomObjectType .objects .all ()
88
- for custom_type in custom_object_types :
89
- # Only yield already cached models during discovery
90
- if CustomObjectType .is_model_cached (custom_type .id ):
91
- model = CustomObjectType .get_cached_model (custom_type .id )
92
- if model :
93
- yield model
63
+ # def get_models(self, include_auto_created=False, include_swapped=False):
64
+ # """Return all models for this plugin, including custom object type models."""
65
+ # # Get the regular Django models first
66
+ # for model in super().get_models(include_auto_created, include_swapped):
67
+ # yield model
68
+ #
69
+ # # Skip custom object type model loading if running during migration
70
+ # if is_running_migration():
71
+ # return
72
+ #
73
+ # # Suppress warnings about database calls during model loading
74
+ # with warnings.catch_warnings():
75
+ # warnings.filterwarnings(
76
+ # "ignore", category=RuntimeWarning, message=".*database.*"
77
+ # )
78
+ # warnings.filterwarnings(
79
+ # "ignore", category=UserWarning, message=".*database.*"
80
+ # )
81
+ #
82
+ # # Add custom object type models
83
+ # from .models import CustomObjectType
84
+ #
85
+ # # Only load models that are already cached to avoid creating all models at startup
86
+ # # This prevents the "two TaggableManagers with same through model" error
87
+ # custom_object_types = CustomObjectType.objects.all()
88
+ # for custom_type in custom_object_types:
89
+ # # Only yield already cached models during discovery
90
+ # if CustomObjectType.is_model_cached(custom_type.id):
91
+ # model = CustomObjectType.get_cached_model(custom_type.id)
92
+ # if model:
93
+ # yield model
94
94
95
95
96
96
config = CustomObjectsPluginConfig
0 commit comments