def create_model(self, form):
    '\n            Create model helper\n\n            :param form:\n                Form instance\n        '
    try:
        model = self.model()
        form.populate_obj(model)
        self._on_model_change(form, model, True)
        model.save()
    except Exception as ex:
        if (not self.handle_view_exception(ex)):
            flash(gettext('Failed to create record. %(error)s', error=format_error(ex)), 'error')
            log.exception('Failed to create record.')
        return False
    else:
        self.after_model_change(form, model, True)
    return model
Create model helper

:param form:
    Form instance
def create_model(self, form):
    '\n            Create model helper\n\n            :param form:\n                Form instance\n        '
    try:
        model = self.model()
        form.populate_obj(model)
        self._on_model_change(form, model, True)
        model.save()
    except Exception as ex:
        if (not self.handle_view_exception(ex)):
            flash(gettext('Failed to create record. %(error)s', error=format_error(ex)), 'error')
            log.exception('Failed to create record.')
        return False
    else:
        self.after_model_change(form, model, True)
    return model