Closed Jaymon closed 3 years ago
I think I can add a classmethod
Field.iwhere
that can be called anytime a field is set in the query. What I don't like about this is it might couple Query and Orm too tightly again and I just got finished uncoupling them
This was solved with the Field.iquery(query, v)
method that gets run everytime a field is set in a query. The reason why this had to be a different method than Field.iset
is because the iset
method takes an orm instance and the Query instance often doesn't have an orm instance to pass to the iset
method.
I'm not sure if it does this or not, but Query should run values through the isetter method also before it runs the query, that way if you have a mapping from String to int in the isetter methods, say something like:
Then doing something like:
the "foo" value would be converted to 1 before running the query.