Пример #1
0
 def get_label_name(self, field):
     label_str = field.label
     if not label_str:
         label_str = pretty_name(field.name)
     if self.form.label_suffix and label_str[-1] not in ':?.!':
         label_str += self.form.label_suffix
     return label_str
Пример #2
0
    def get_label_name(self, field_or_string):
        if isinstance(field_or_string, types.StringTypes):
            label_str = field_or_string
        else:
            label_str = field_or_string.label

        if label_str == '':  # if empty string is explicitly specified, it really should return empty string
            return ''

        if not label_str:
            label_str = pretty_name(field_or_string.name)
        if self.detail.label_suffix and label_str[-1] not in ':?.!':
            label_str += self.detail.label_suffix
        return label_str
Пример #3
0
 def get_label_name(self, field_or_string):
     if isinstance(field_or_string, types.StringTypes): 
         label_str = field_or_string
     else:
         label_str = field_or_string.label
     
     if label_str == '': # if empty string is explicitly specified, it really should return empty string
         return ''
     
     if not label_str:
         label_str = pretty_name(field_or_string.name)
     if self.detail.label_suffix and label_str[-1] not in ':?.!':
         label_str += self.detail.label_suffix
     return label_str
Пример #4
0
 def get_label_name(self, field):
     label_str = field.label
     if not label_str:
         label_str = pretty_name(field.name)
     return label_str