use help_text to document model columns

このページは日本語には対応しておりません。随時翻訳に取り組んでいます。翻訳に関してご質問やご意見ございましたら、お気軽にご連絡ください。

Metadata

ID: python-django/model-help-text

Language: Python

Severity: Notice

Category: Best Practices

Description

Use help_text to document the fields used in your database.

Learn More

Non-Compliant Code Examples

class MyModel(models.Model):
  my_field = models.DateField()
  last_name = models.CharField(max_length=40)  # add help_text to explain what this field is doing

Compliant Code Examples

class MyModel(models.Model):
  my_field = models.DateField(help_text = "Use format YYYY/MM/DD")
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Analysis

PREVIEWING: rtrieu/product-analytics-ui-changes