def populate_model(model_or_inst, excludes=None, only=None):
    """
    Call `make_request_parser()` to build a `RequestParser`, use it extract user request data,
      and padding the data into model instance.
    If user passed a model class, instead of model instance, create a new instance use the extracted data.
    """
    inst = model_or_inst if _is_inst(model_or_inst) else model_or_inst()

    parser = make_request_parser(model_or_inst, excludes, only, for_populate=True)
    req_args = parser.parse_args()

    for key, value in req_args.items():
        setattr(inst, key, value)

    return inst
def populate_model ( model_or_inst , excludes = None , only = None ) : inst = model_or_inst if _is_inst ( model_or_inst ) else model_or_inst ( ) parser = make_request_parser ( model_or_inst , excludes , only , for_populate = True ) req_args = parser . parse_args ( ) for key , value in req_args . items ( ) : setattr ( inst , key , value ) return inst
Call `make_request_parser()` to build a `RequestParser`, use it extract user request data,
      and padding the data into model instance.
    If user passed a model class, instead of model instance, create a new instance use the extracted data.