How can I programmatically obtain the max_length of a Django model field?

Viewed 14994

Say I have a Django class something like this:

class Person(models.Model):
    name = models.CharField(max_length=50)
    # ...

How can I programatically obtain the max_length value for the name field?

2 Answers
Related