Bauble / bauble.classic

this is how Bauble and Ghini both started
GNU General Public License v2.0
10 stars 34 forks source link

QueryBuilder quotes all values including None #237

Closed mfrasca closed 8 years ago

mfrasca commented 8 years ago

when you use the QueryBuilder, it is of great help for indeed building a query. it has some limitations and mistakes. it knows nothing of Empty (it applies to sets, not to values). see #236. it quotes None (NoneType) into "None" (str). @RoDuth again in #236. it quotes all numeric values.

mfrasca commented 8 years ago

please note that using 'Empty' will produce invalid queries, because the Query Builder limits the left hand side of the binary test to a scalar value, while Empty applies to sets. so you can sort-of produce a query using Empty, but you need to remove whatever attribute you selected to fool the Query Builder. like: the query builder allows you construct this: accession where plants.id = Empty while you meant and need this: accession where plants = Empty