-
Notifications
You must be signed in to change notification settings - Fork 51
Configuration
rvinzent edited this page May 17, 2020
·
1 revision
dynamic_models
has a few configuration options available. Set these under a DYNAMIC_MODELS
object in the Django settings.
# settings.py
INSTALLED_APPS = [
...
'dynamic_models',
...
]
DYNAMIC_MODELS = {
...configuration options...
}
The default max_length
value to use when generating CharField
. Defaults to 255
Set how long in seconds to keep Django models in the cache. Cache hits should result in less queries to the database.
Register generated dynamic models under this app label. Defaults to dynamic_models
Use this prefix for cached model entries. Defaults to dynamic_models_
.
A dictionary of field names to Field
instances that can be used to inject a common set of fields into all generated dynamic models. Defaults to {}
DEFAULT_FIELDS = {
'common_field': fields.IntegerField(),
}