I have a database table like this:
+-------------------------------------------------------------+
| id | res_id | path | overrides |
|-------------------------------------------------------------|
| 1 | res_1 | res_1 | {"enabled": True} |
| 2 | res_1.1 | res_1.res_1.1 | {"enabled": False}|
| 3 | res_1.2 | res_1.res_1.2 | {"enabled": False}|
| 4 | res_1.1.1 | res_1.res_1.1.res_1.1.1| {"enabled": False}|
+-------------------------------------------------------------+
The overrides is for setting a breaking point to inheritance. So, if I query the res_1.1.1m I'd normally get also resources 1 & 2, because of the inheritance. But now, there is "enabled": True in 1 and it doesn't inherit anywhere, so the query would return only 2 & 4.
The question is, how can I filter out objects where the overrides is "enabled": True? I've tried e.g. this: .filter(MyModel.overrides["enabled"] is not True), this doesn't seem to work.
I've also tried using dictionary methods get(), values() and keys(), but they give me an error, e.g. AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' object associated with MyModel.overrides has an attribute 'get'.
The field overrides in a JSONB -field.