Skip to main content

An app that provides Django model comment migration

Project description

Build https://pypi.org/project/django-comment-migrate/

An app that provides Django model comment migration

English | 简体中文

Feature

  • Automatic migration model help_text to comment

  • Provide a command to migrate the comment of the specified app

Examples

  1. download python package:

    pip install django-comment-migrate
  2. add django_comment_migrate app

    project/project/settings.py

    INSTALLED_APPS =[
        "django_comment_migrate",
        ...
    ]
  3. 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'
  4. execute database migrate:

    python manage.py makemigrations
    python manage.py migrate

Now check the database table, comments have been generated.

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

  1. Install Tox:

    pip install tox
  2. Run:

    tox

Supported Database

  • MySQL

  • Postgres

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-comment-migrate-0.0.8.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

django_comment_migrate-0.0.8-py3-none-any.whl (8.2 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