src/pyams_utils/__init__.py
changeset 387 604807051f00
parent 367 2c95d34496f5
child 408 cf2304af0fab
equal deleted inserted replaced
386:15801a3108dc 387:604807051f00
    27 
    27 
    28 
    28 
    29 def get_field_doc(self):
    29 def get_field_doc(self):
    30     """Try to get FieldProperty field docstring from field interface"""
    30     """Try to get FieldProperty field docstring from field interface"""
    31     field = self._FieldProperty__field
    31     field = self._FieldProperty__field
    32     if field.title and field.description:
    32     if field.title:
    33         return '{0}: {1}'.format(field.title, field.description)
    33         if field.description:
    34     elif field.title:
    34             return '{0}: {1}'.format(field.title, field.description)
    35         return field.title
    35         else:
       
    36             return field.title
    36     else:
    37     else:
    37         return super(self.__class__, self).__doc__
    38         return super(self.__class__, self).__doc__
    38 
    39 
    39 
    40 
    40 FieldProperty.__doc__ = property(get_field_doc)
    41 FieldProperty.__doc__ = property(get_field_doc)