Brad's Blog

Published: 2015-03-17

Django hack: Help text on a model instance

curry django functional

If you've been been working with Django for a while, you're probably familiar with the help_text attribute for model fields. It gives us a hook for adding descriptive text that gets automatically included on forms or in the admin. But what if you want to access that same information on an instance of model object? Let's look at an example! Assume we have a simple model: class BlogPost(models.Model): title = models.CharField( max_length=50, unique=True ...