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]
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'
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'
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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48c8f8743fe087a71d2db36c7eae07d516acb9a5f9d82801c53b68da3f8493ed |
|
MD5 | e7cad750c65ca428d9b029e41cc6af26 |
|
BLAKE2b-256 | 1fc5539ae6a138d3d73eebd0ba232679b936a2f2a565b09e9800c9b51731cd30 |
Hashes for django_comment_migrate-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c006e374cf55eaf1d2b0870c36ccc4681cbeb94b2276a04abdc39f5258c1d5d6 |
|
MD5 | f3669c77dfb9ff8218cef6d38ed4a470 |
|
BLAKE2b-256 | cfddcc82024e91cba10304ef431566196b5ffe4d43e747b4e2c81ad14060c692 |