use help_text to document model columns

Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.

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: mervebolat/span-id-preprocessing