def type_class(self):
     field_config = self.attrs.get('type')
     if field_config and field_config.config_value:
         return to_camel_case(field_config.config_value)
     if self.is_ref:
         return to_camel_case(self.name)
     else:
         if self.is_array:
             type_char = self.ftype[1]
             return self.field_type_map.get(type_char, 'String')
         else:
             return self.field_type_map.get(self.ftype, 'String')
Пример #2
0
def test_to_camel_case():  # noqa
    assert to_camel_case('user') == 'User'
    assert to_camel_case('User') == 'User'
    assert to_camel_case('userStory') == 'UserStory'
    assert to_camel_case('UserStory') == 'UserStory'
    assert to_camel_case('User-Story') == 'UserStory'
    assert to_camel_case('User_Story') == 'UserStory'
    assert to_camel_case('User Story') == 'UserStory'
    assert to_camel_case('user story') == 'UserStory'
Пример #3
0
 def service_name(self):
     return to_camel_case(self.name + 'Service')
Пример #4
0
 def ui_delegate_name(self):
     return to_camel_case(self.name) + 'Delegate'
Пример #5
0
 def camel_name(self):
     return to_camel_case(self.name)