Skip to main content

A django module that allows to configure a global or model based database table prefix

Project description

Django Model Prefix

PyPI Test Status Codecov

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_model_prefix-1.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

django_model_prefix-1.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file django_model_prefix-1.1.0.tar.gz.

File metadata

  • Download URL: django_model_prefix-1.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for django_model_prefix-1.1.0.tar.gz
Algorithm Hash digest
SHA256 16fe83c26bafa4d3ef7cb403aae33a104f8490bdf67853e0f9e6e7b4e358fe58
MD5 d1911c0ca4549c2c7e3babbbbc276d04
BLAKE2b-256 7fc0b5879e21c0c9abdf86f846d33f634df47130fef8a7ddddb5b8017fdea611

See more details on using hashes here.

File details

Details for the file django_model_prefix-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_model_prefix-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 daf741524803a5c02486d6efc3055adfee6cda60d2fe6430de817afe467938ad
MD5 3603bd6488fad63c01b3a029d2849892
BLAKE2b-256 3de2998bf6cd25156e7598458feaabc5f85c20c67a4f8dd6499b82e3aed77d6c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page