Model methods short_description
attribute values
For model methods, you can provide translations to Django and the admin site
with the short_description
attribute:
from django.db import models
class MyThing(models.Model):
kind = models.ForeignKey(
ThingKind,
on_delete=models.CASCADE,
related_name='kinds',
verbose_name=_('kind'),
)
def is_mouse(self):
return self.kind.type == MOUSE_TYPE
is_mouse.short_description = 'Is it a mouse?'