def create_obj(django_model, new_obj_key=None, *args, **kwargs):
try:<EOL><INDENT>if isinstance(django_model, six.string_types):<EOL><INDENT>django_model = apps.get_model(django_model)<EOL><DEDENT>assert is_valid_django_model(django_model), (<EOL>"<STR_LIT>"<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>).format(django_model)<EOL>data = kwargs.get(new_obj_key, None) if new_obj_key else kwargs<EOL>new_obj = django_model(**data)<EOL>new_obj.full_clean()<EOL>new_obj.save()<EOL>return new_obj<EOL><DEDENT>except LookupError:<EOL><INDENT>pass<EOL><DEDENT>except ValidationError as e:<EOL><INDENT>raise ValidationError(e.__str__())<EOL><DEDENT>except TypeError as e:<EOL><INDENT>raise TypeError(e.__str__())<EOL><DEDENT>except Exception as e:<EOL><INDENT>return e.__str__()<EOL><DEDENT>
Function used by my on traditional Mutations to create objs
:param django_model: A valid Django Model or a string with format:
<app_label>.<model_name>
:param new_obj_key: Key into kwargs that contains de data: new_person
:param args:
:param kwargs: Dict with model attributes values
:return: instance of model after saved it