Hey guys! Nowadays I'm using a some filter_outs but they got update and insert erros on record versioning.
I'm solving update issue using before_update like this:
def remove_filter(s,field):
field_obj = s.query.db[str(s.query).split('.')[0][1:]][field]
field_obj.filter_out = ''
for t in db.tables:
db[t]._before_update.insert(0, lambda s, f: not [remove_filter(s, field) for field in f])
s.query.db is the returned db;
str(s.query).split('.')[0][1:] is an ugly way to get table name
field is the field_name.
With update I got an ugly solution, but I got a solution. With insert I can't do it because before_insert don't have a Query object and I can't get table name
Is there a better way to solve it and remove filter_outs before inserts and updates?