django_database_colum_comment
auto add comment for columns of MySQL or PostgreSQL
the property verbose_name or help_text of the django model will be used as comment for columns
Database Supported
- MySQL
- PostgreSQL
How to use
the model, you need to notice that the order verbose_name is at the first, then help_text
name = models.CharField(max_length=200, verbose_name="名称", blank=True, default=None)
age = models.SmallIntegerField(help_text="年龄", blank=True, default=None)
then, install the package
pip install addcomments
in settings.py add app
INSTALLED_APPS += [
'addcomments',
]
next, type command
python manage.py addcolumncomments
finally, the info will be printed, all the models created will be processed
## MySQL
-- FOR test_student.name
ALTER TABLE test_student
MODIFY COLUMN `name` varchar(200) COLLATE utf8mb4_bin NOT NULL COMMENT '名称'
-- FOR test_student.age
ALTER TABLE test_student
MODIFY COLUMN `age` smallint(6) NOT NULL COMMENT '年龄'
## PostgreSQL
-- FOR test_student.name
COMMENT ON COLUMN test_student.name IS '名称'
-- FOR test_student.age
COMMENT ON COLUMN test_student.age IS '年龄'
If any bug
you can fix by yourself or commit your issue here, I will fix it
Metadata
Release files for addcomments 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| addcomments-1.0.0.tar.gz | 3.7 kB | Without provenance | Details for addcomments-1.0.0.tar.gz |
Release files / addcomments-1.0.0.tar.gz
| Download URL | addcomments-1.0.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6a4f5f26343edcf84a0c60dbb23d4c1e4b42d5be357d869760b0172c3cccd0c
|
|
BLAKE2b-256 checksum How to use checksums |
4f9b287865638a8b67a0b42dd004743a603703916f0fbbe6c1d509623fb3ad20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.7
|
Security for addcomments 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.