Reputation: 26924
You see the MySQL tables in the Sequel Pro, every field has a Comment:
Whether I can set the field comment in the Model?
class Account(models.Model):
balance = models.CharField(max_length=16)
grade = models.CharField(max_length=1, default=1) # whether there is a property for us to set field comment?
Upvotes: 0
Views: 1536
Reputation: 13726
As I've answered in a similar question:
I think we could implement that feature. (Yes I changed my mind from six years ago when I wontfix'd the ticket.)
Upvotes: 1
Reputation: 5740
You can't set comment on a field in django (please check this issue)
I understand the idea, but I'm afraid it doesn't have a good usefulness/noise ratio.
The ORM doesn't aim at providing a Python interface for every feature of the supported database engines. Its goal is "just" to provide an OO API.
Since there's neither a clean API proposal, nor a patch, nor a convincing explanation of the value added by this feature, I'm going to close this ticket.
PS: you can use django raw sql queries and manually set the comment.
Upvotes: 1