Beispiel #1
0
def add_nested_methods_for_model(lcls, model, category):
    for name, field in model.get_nested_method_fields():
        cname = '%s%sNestedMethod' % (model.__name__, utils.snake_case_to_camel_case(name))
        lcls[cname] = type(cname,
                           (ClientObjectNestedMethod,),
                           {'category': category,
                            'model': model,
                            'nested_field': field,
                            'nested_field_name': name})
Beispiel #2
0
def add_nested_methods_for_model(lcls, model, base_class):
    for name, field in model.ClientModel.get_nested_method_fields():  # pylint: disable=W0612
        cname = '%s%sNestedMethod' % (model.__name__, utils.snake_case_to_camel_case(name))
        lcls[cname] = type(cname, (base_class,), {})