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'
execute database migrate:
python manage.py makemigrations python manage.py migrate
Now check the database table, comments have been generated.
Custom comment field
In settings.py:
DCM_COMMENT_KEY='verbose_name' DCM_TABLE_COMMENT_KEY='verbose_name'
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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ee24b6109ef95c61c4f8e93fede6115e2acd334b3d1e29f836ad0487a89f9bb |
|
MD5 | 03807f897045333d1fa28d6bb7bf67b1 |
|
BLAKE2b-256 | 0e63e1e6070b021d6fb8bbd600378ad6a8030b538af6ae122702791b398a6cff |
Hashes for django_comment_migrate-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 461f7ce44b682412a699f269a7dc45d270b9d9496758c38b30910ba9995d4d42 |
|
MD5 | 4111d62ea30e22e75ff38c24a30e94e3 |
|
BLAKE2b-256 | f77013200d62e4b34197e98972c1093f985b00db525da9277a50d034e4c8a4c6 |