When reading source code of Django, I find some statements:
class Field(object):
"""Base class for all field types"""
__metaclass__ = LegacyConnection
# Generic field type description, usually overriden by subclasses
def _description(self):
return _(u'Field of type: %(field_type)s') % {
'field_type': self.__class__.__name__
}
description = property(_description)
class AutoField(Field):
description = _("Integer")
I know it set description as 'Integer', but don't understand the syntax: description = _("Integer")
.
Can some one help on it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…