Skip to main content

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 [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

  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'
            verbose_name = 'It is Comment Table'
  4. add app

    project/app/settings.py

    DCM_COMMENT_APP=["app"]
  5. 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

  1. Install Tox:

    pip install tox
  2. Run:

    tox

Supported Database

  • MySQL

  • PostgreSQL

  • Microsoft SQL Server

Release files for django-comment-migrate 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-comment-migrate 0.1.7
File Size Uploaded
django-comment-migrate-0.1.7.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-comment-migrate 0.1.7
File Interpreter ABI Platform
django_comment_migrate-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 18.2 kB

Release files / django-comment-migrate-0.1.7.tar.gz

Download URL django-comment-migrate-0.1.7.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
13e9d613e9a1f4af7fb212052bd4e6f79c288503d0be38061c2871f8a5c501aa
BLAKE2b-256 checksum
How to use checksums
5d6bb54fbe0ab7755c51ef4f0aaac66ffba978258f411f68850d0af8c99ff4d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / django_comment_migrate-0.1.7-py3-none-any.whl

Download URL django_comment_migrate-0.1.7-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6545b447f603ac8ff367f73a569af9de3ba53ae81dc344aa36fcb4761c22d161
BLAKE2b-256 checksum
How to use checksums
583c671d52db3d1739eacd0892786c205c0d6eb5fe055523d434ff0c6cfa1650
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page