src/pyams_utils/property.py
changeset 122 88f33861b143
parent 100 119b9c2f3022
child 170 0013ddcfdc37
equal deleted inserted replaced
121:2d5da1421297 122:88f33861b143
    28     It's main purpose is for documentation needs.
    28     It's main purpose is for documentation needs.
    29     """
    29     """
    30 
    30 
    31     @property
    31     @property
    32     def __doc__(self):
    32     def __doc__(self):
    33         return self._FieldProperty__field.description or super(FieldProperty, self).__doc__
    33         field = self._FieldProperty__field
       
    34         if field.title and field.description:
       
    35             return '{0}: {1}'.format(field.title, field.description)
       
    36         elif field.title:
       
    37             return field.title
       
    38         else:
       
    39             return super(FieldProperty, self).__doc__
    34 
    40 
    35 
    41 
    36 class cached(object):
    42 class cached(object):
    37     """Custom property decorator to define a property or function which is calculated only once
    43     """Custom property decorator to define a property or function which is calculated only once
    38 
    44