You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the [Configuration Guide](https://django-tenant-options.readthedocs.io/en/latest/usage.html#configuration-guide) for more details on available settings.
46
+
45
47
## Core Concepts
46
48
47
49
### Option Types
@@ -67,6 +69,10 @@ django-tenant-options provides three types of options:
67
69
68
70
## Model Configuration
69
71
72
+
> ⚠️ Warning
73
+
>
74
+
> The package automatically adds an `objects` Manager and associated QuerySet to each option and selection model. If you define a custom Manager or QuerySet, ensure it inherits from `OptionManager` or `OptionQuerySet`, or your optyions and selections will not work as intended. Also, an additional `unscoped` Manager is available for querying all options, including soft-deleted ones.
75
+
70
76
### 1. Option Models
71
77
72
78
Create your Option model by inheriting from `AbstractOption`:
Django Tenant Options can be configured through your Django settings. Add a `DJANGO_TENANT_OPTIONS` dictionary to your settings:
308
+
309
+
```python
310
+
DJANGO_TENANT_OPTIONS= {
311
+
"TENANT_MODEL": "myapp.Tenant",
312
+
# ... other settings
313
+
}
314
+
```
315
+
316
+
### Base Model Classes
317
+
318
+
Django Tenant Options allows you to customize the base classes used for models, managers, querysets and field types. This is particularly useful when integrating with packages like django-auto-prefetch or implementing custom behavior across all tenant option models.
319
+
320
+
#### Configuration Through Settings
321
+
322
+
Configure base classes globally in your Django settings:
0 commit comments