Skip to main content

Django management command to generate SQL for applying your models' verbose name and help_text as PostgreSQL COMMENTs

Project description

Django management command to generate SQL for applying your models’ and fields’ verbose_name and help_text as PostgreSQL COMMENT statements.

Compatibility

Python 2.7–3.11.

Django 1.11–4.2.

Quickstart

Install Django SQL COMMENT:

pip install django-sql-comment

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'django_sql_comment',
    ...
)

Run ./manage.py sqlcomment myapp to look at SQL generated, or ./manage.py sqlcomment myapp | ./manage.py dbshell to apply it to your database.

If you’re brave enough to apply the comments automatically on every migration, you can take the risk to add to your AppConfig:

from django.db.models.signals import post_migrate
from django_sql_comment import sqlcomment_post_migrate
...
class MyAppConfig(AppConfig):
    def ready(self):
        post_migrate.connect(sqlcomment_post_migrate)

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-sql-comment-1.0.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

django_sql_comment-1.0.0-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

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