Enforce valid value for ref in XML
It is a common mistake to put the wrong xml ID in a ref attribute but it is not detected because the wrong ID exists in the table (and maybe by change it is the same as the correct one). Such mistakes can be very time consuming to discover.
I propose the in convert.py
get_id
return the model and the id (a little bit like a reference field) and the consumer of the method check that the model is the one expected when we know.
The only draw back is that the contextual ref
method used with eval
can not do that and so it must be wrapped to provide the current behavior.