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')
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'
def service_name(self): return to_camel_case(self.name + 'Service')
def ui_delegate_name(self): return to_camel_case(self.name) + 'Delegate'
def camel_name(self): return to_camel_case(self.name)