Closed josejachuf closed 2 years ago
Error also with
emmett 2.4.5 emmett 2.3.1
@josejachuf unfortunately, the unique
validator is still based on the pretty-old pyDAL implementation. I already planned some changes for 2.5 in regard of models validations, but with 2.4 there's no easy way support this.
In order to solve your issue in the meantime you have two options:
i) rely on index constraint only, dropping the unique
parameter from you field and implementing the validation logic manually on the "controller" side
ii) hack the validation in your REST endpoint (I would say in a before_update
callback) doing what forms do, eg:
@your_rest_module.before_update
def _fix_unique_validator(row, params):
current._dbvalidation_record_id_ = row.id
I gonna keep this open until I write down a proper feature change for 2.5
I'm closing this in favour of emmett-framework/firestorm#2
I have a model with a unique field, if I make a put (using Emmett-REST) I get an error in which you do not be valid and forces me to change name value
This fails with these versions:
and works fine whit: