Skip to content

Instantly share code, notes, and snippets.

View tpoisseau's full-sized avatar
🤝
New Zakodium Fullstack Developer

tpoisseau tpoisseau

🤝
New Zakodium Fullstack Developer
View GitHub Profile
@tpoisseau
tpoisseau / models.py
Created January 9, 2019 08:37 — forked from andialbrecht/models.py
Adds Meta option db_column_prefix that prepends a per-model prefix to db column names
# -*- coding: utf-8 -*-
# This hack adds a new Meta option "db_column_prefix". If not None all
# database columns in a model will be prepended with this prefix (the
# database columns, not the attributes). See Person model for an
# example.
#
# Issues:
# - How to set a prefix for a m2m table? - If "through" argument is
# not specified on a M2MField, Django automatically adds a model