﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36604	"Add utility for lazy model resolution by string label (e.g. ""app_label.ModelName"")"	Mbulelo_Peyi	Mbulelo_Peyi	"This feature proposes the addition of two utility functions to simplify lazy model resolution in Django:

- get_model_by_label(model_label: str)
  Resolves and returns a model class from a string label like 'app_label.ModelName'.

- lazy_model(model_label: str)  
  Returns a `SimpleLazyObject` that lazily resolves a model using the above utility.

These functions are useful when:
- Avoiding circular imports (e.g., in apps.py, signals.py, or settings.py)
- Dynamically referencing models by name
- Loading models safely before the app registry is fully ready

This pattern is currently re-implemented in many Django projects and third-party packages. Including it in Django would standardize a safe, performant, and readable approach to lazy model loading.

The get_model_by_label() function includes:
- Input validation
- Exception handling with ImproperlyConfigured
- Caching via @lru_cache to improve performance
"	New feature	closed	Utilities	5.2	Normal	wontfix		Mbulelo_Peyi	Unreviewed	0	1	1	0	1	0
