An app that provides Django model comment migration
Project description
An app that provides Django model comment migration
English | 简体中文
Feature
Automatic migration model help_text to comment [Support customization]
Automatically migrate the verbose_name of the model to the table comment [Support customization]
Provide a command to migrate the comment of the specified app
Examples
download python package:
pip install django-comment-migrate
add django_comment_migrate app
project/project/settings.py
INSTALLED_APPS =[ "django_comment_migrate", ... ]
add model
project/app/model.py
from django.db import models class CommentModel(models.Model): no_comment = models.TextField() aaa = models.IntegerField(default=0, help_text="test default") help_text = models.CharField(max_length=40, help_text="this is help text") class Meta: app_label = 'tests' db_table = 'comment_model' verbose_name = 'It is Comment Table'
add app
project/app/settings.py
DCM_COMMENT_APP=["app"]
execute database migrate:
python manage.py makemigrations python manage.py migrate
Now check the database table, comments have been generated.
Custom config
In settings.py:
DCM_COMMENT_KEY='verbose_name' DCM_TABLE_COMMENT_KEY='verbose_name' DCM_BACKEND={ "new-engine": "engine.path" } DCM_COMMENT_APP=["app"]
Command
Provides a comment migration command, which allows the database to regenerate comments:
python manage.py migratecomment [app_label]
The command needs to be executed after all migrations are executed
Running the tests
Install Tox:
pip install tox
Run:
tox
Supported Database
MySQL
PostgreSQL
Microsoft SQL Server
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
Hashes for django-comment-migrate-0.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebdf2e63a7003f8bfbf399a1e7290f416e8e91bc79c8c6a9f26a743071167e1d |
|
MD5 | 70e3fe386b3c7ee72de9d1727577b598 |
|
BLAKE2b-256 | eac82f7b21d1dc54ebcda58d63d9eca5608e64bf0aebd7dcb5582ddba2fd2c50 |
Hashes for django_comment_migrate-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48507dc29cdcf8cf6586ec747f4b11446efc61be93c33c5426e31a7799f1172f |
|
MD5 | 6ed6f1a313526e9737de72c8ae2fc3fe |
|
BLAKE2b-256 | c6171e38ce3bed2b2e9b95ebb1ed04a5bc935b556848c7fc03dd80adadd3c2de |