fix-#744: Querying by a field defined in a subclass raises InvalidQueryError