Skip to content

An django module that allows to confgiure a global or model based database table prefix

License

Notifications You must be signed in to change notification settings

anx-abruckner/django-model-prefix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Install using pip:

pip install git+https://github.com/nezhar/django-model-prefix@main

Add model_prefix to your INSTALLED_APPS list. Make sure it is the first app in the list

INSTALLED_APPS = [
    'django_db_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

About

An django module that allows to confgiure a global or model based database table prefix

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%