A django module that allows to configure a global or model based database table prefix
Project description
Django Model Prefix
A Django package that adds a global or model based database table prefix
Installation
Install using pip:
pip install django-model-prefix
Add model_prefix to your INSTALLED_APPS list. Make sure it is the first app in the list
INSTALLED_APPS = [
'model_prefix',
...
]
Usage
Global table prefix
The global database table prefix can be configured using the DB_PREFIX
setting
DB_PREFIX = "foo_"
Model table prefix
Optionally a model based prefix can also be defined by extending the models meta class
class Meta:
db_prefix = "bar_"
This can be also used in order to disable the global prefix for a specific model
class Meta:
db_prefix = None
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-model-prefix-1.0.0.tar.gz
.
File metadata
- Download URL: django-model-prefix-1.0.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d534446233f6cabdf41451a2157f7b2ab27dc8d84c35a338ca974f5d0acf44b3 |
|
MD5 | dcb56c0e3ea55ccc6aa9ebf912212f8a |
|
BLAKE2b-256 | 60cf00868da14b318c68eee955ca8f43d27baef8c7b77ac6c8dcf0f3185eff03 |
Provenance
File details
Details for the file django_model_prefix-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: django_model_prefix-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84e76ffbc29f870f0913b0b4745e6f44f1885951594c8cc4479c70782565b187 |
|
MD5 | 6a62fd629263251d7fc482574706e648 |
|
BLAKE2b-256 | 35a595c4c24fe9e7a2dd0946e9a3f4bdf53fa73727b1f2e2850d1731e6fbf6f2 |