Closed jamesaoverton closed 2 years ago
1, 2, and 3 could conceivably conflict, for instance a column might have a datatype condition like in("A", "B", "C")
and also have an associated from()
or under()
structure. In such a case, which one should take priority?
Here's the relevant bit of Gizmos search
using SQL's LIKE functionality to match substrings: https://github.com/ontodev/gizmos/blob/36a0c0ea678da2d8bdc2fc9f0dd8c09d964c2faa/gizmos/search.py#L95-L100
As @beckyjackson works on forms for editing rows with HTML forms (related to #35), it would be good to add support for autocomplete text fields. We tend to use Typeahead, which expects data in a simple JSON format, e.g. Gizmos
search
. The format is simple enough once we know what the available values are, and that should be guided by the metatable information. For a given field that we're editing:in("A", "B", "C")
then the autocomplete should provide: "A", "B", "C"from(foo.bar)
, the autocomplete should provide values from thefoo.bar
columnunder(foo.bar, "baz")
, the autocomplete should provide values from the "baz" branch of thefoo.bar
treeSo I think we need a function in the
validate
module that takes a table, column, and the string to complete, and returns a JSON array formatted for Typeagead.