Django model naming convention

Django models are just Python classes, so the Python naming conventions detailed in PEP-8 apply.

For example:

  1. Person
  2. Category
  3. ZipCode

If Django fails to pluralize the class name properly when creating the corresponding table, you can easily override the pluralization by setting a custom verbose_name_plural field in an inner META class. For example:

class Story(models.Model):
    ...

    class Meta:
        verbose_name_plural = "stories"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)