django-comment-migrate


Namedjango-comment-migrate JSON
Version 0.1.7 PyPI version JSON
download
home_pagehttps://github.com/starryrbs/django-comment-migrate.git
SummaryAn app that provides Django model comment migration
upload_time2023-01-10 07:33:12
maintainer
docs_urlNone
authorstarryrbs
requires_python>=3.6
licenseMIT
keywords django-comment-migrate
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Django Comment Migrate
======================

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

An app that provides Django model comment migration

English \| `简体中文 <./README-zh_CN.rst>`__

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

   .. code:: python

       INSTALLED_APPS =[
           "django_comment_migrate",
           ...
       ]

3. add model

   project/app/model.py

   .. code:: python

       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

   .. code:: python

       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

.. |Build| image:: https://travis-ci.org/starryrbs/django-comment-migrate.svg?branch=master
.. |https://pypi.org/project/django-comment-migrate/| image:: https://img.shields.io/pypi/v/django-comment-migrate

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/starryrbs/django-comment-migrate.git",
    "name": "django-comment-migrate",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "django-comment-migrate",
    "author": "starryrbs",
    "author_email": "1322096624@qq.com",
    "download_url": "https://files.pythonhosted.org/packages/5d/6b/b54fbe0ab7755c51ef4f0aaac66ffba978258f411f68850d0af8c99ff4d8/django-comment-migrate-0.1.7.tar.gz",
    "platform": null,
    "description": "Django Comment Migrate\n======================\n\n|Build| |https://pypi.org/project/django-comment-migrate/|\n\nAn app that provides Django model comment migration\n\nEnglish \\| `\u7b80\u4f53\u4e2d\u6587 <./README-zh_CN.rst>`__\n\nFeature\n-------\n\n-  Automatic migration model help\\_text to comment [Support customization]\n-  Automatically migrate the verbose_name of the model to the table comment [Support customization]\n-  Provide a command to migrate the comment of the specified app\n\nExamples\n--------\n\n1. download python package::\n\n    pip install django-comment-migrate\n\n2. add django\\_comment\\_migrate app\n\n   project/project/settings.py\n\n   .. code:: python\n\n       INSTALLED_APPS =[\n           \"django_comment_migrate\",\n           ...\n       ]\n\n3. add model\n\n   project/app/model.py\n\n   .. code:: python\n\n       from django.db import models\n\n       class CommentModel(models.Model):\n           no_comment = models.TextField()\n           aaa = models.IntegerField(default=0, help_text=\"test default\")\n           help_text = models.CharField(max_length=40,\n                                        help_text=\"this is help text\")\n\n           class Meta:\n               app_label = 'tests'\n               db_table = 'comment_model'\n               verbose_name = 'It is Comment Table'\n\n4. add app\n\n    project/app/settings.py\n\n   .. code:: python\n\n       DCM_COMMENT_APP=[\"app\"]\n\n5. execute database migrate::\n\n    python manage.py makemigrations\n    python manage.py migrate\n\nNow check the database table, comments have been generated.\n\nCustom config\n---------------\n\nIn settings.py::\n\n    DCM_COMMENT_KEY='verbose_name'\n    DCM_TABLE_COMMENT_KEY='verbose_name'\n    DCM_BACKEND={\n            \"new-engine\": \"engine.path\"\n    }\n    DCM_COMMENT_APP=[\"app\"]\n\nCommand\n-------\n\nProvides a comment migration command, which allows the database to\nregenerate comments::\n\n    python manage.py migratecomment  [app_label]\n\nThe command needs to be executed after all migrations are executed\n\nRunning the tests\n-----------------\n\n1. Install Tox::\n\n    pip install tox\n\n2. Run::\n\n    tox\n\nSupported Database\n------------------\n\n-  MySQL\n-  PostgreSQL\n-  Microsoft SQL Server\n\n.. |Build| image:: https://travis-ci.org/starryrbs/django-comment-migrate.svg?branch=master\n.. |https://pypi.org/project/django-comment-migrate/| image:: https://img.shields.io/pypi/v/django-comment-migrate\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An app that provides Django model comment migration",
    "version": "0.1.7",
    "split_keywords": [
        "django-comment-migrate"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "583c671d52db3d1739eacd0892786c205c0d6eb5fe055523d434ff0c6cfa1650",
                "md5": "fb957c279390aa3478fd4f48c4fdf224",
                "sha256": "6545b447f603ac8ff367f73a569af9de3ba53ae81dc344aa36fcb4761c22d161"
            },
            "downloads": -1,
            "filename": "django_comment_migrate-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fb957c279390aa3478fd4f48c4fdf224",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 10257,
            "upload_time": "2023-01-10T07:33:10",
            "upload_time_iso_8601": "2023-01-10T07:33:10.913543Z",
            "url": "https://files.pythonhosted.org/packages/58/3c/671d52db3d1739eacd0892786c205c0d6eb5fe055523d434ff0c6cfa1650/django_comment_migrate-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5d6bb54fbe0ab7755c51ef4f0aaac66ffba978258f411f68850d0af8c99ff4d8",
                "md5": "821e275149ec5db1d2f13b4e369a917c",
                "sha256": "13e9d613e9a1f4af7fb212052bd4e6f79c288503d0be38061c2871f8a5c501aa"
            },
            "downloads": -1,
            "filename": "django-comment-migrate-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "821e275149ec5db1d2f13b4e369a917c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 7928,
            "upload_time": "2023-01-10T07:33:12",
            "upload_time_iso_8601": "2023-01-10T07:33:12.697002Z",
            "url": "https://files.pythonhosted.org/packages/5d/6b/b54fbe0ab7755c51ef4f0aaac66ffba978258f411f68850d0af8c99ff4d8/django-comment-migrate-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-10 07:33:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "starryrbs",
    "github_project": "django-comment-migrate.git",
    "lcname": "django-comment-migrate"
}
        
Elapsed time: 0.10195s