5

Models in django can come with a meta class like so:

class Address(models.Model):
    """Address model."""

    class Meta:
        """Meta McMetaface."""

        verbose_name = "Address"
        verbose_name_plural = "Addresses"

    address_line = models.CharField(max_length=256)
    postcode = models.CharField(max_length=10)

    def __str__(self):
        """Return address without post code."""
        return self.address_line

My metaclass is whimsical at best. Does Python or Django have a standard text for meta classes?

AncientSwordRage
  • 7,086
  • 19
  • 90
  • 173
  • 1
    It's a docstring for documentation. A standard text would serve this purpose purely. This is also valid for a silly name or some content that just repeats the `class` or `def` line above. If there is nothing helpful to write, leave it empty. – Klaus D. Jul 27 '16 at 00:38
  • @KlausD. nothing about how it should describe the metaness of the class in the pep? – AncientSwordRage Jul 27 '16 at 00:48

1 Answers1

6

There's no point in writing a docstring for Meta. It's a standard name that every model defines, and means the same thing in every model. Just don't write a docstring.

Ned Batchelder
  • 364,293
  • 75
  • 561
  • 662