A QueryDefinition contains all information about a data layer query. It can output a json definition that can be used to subscribe to a query.
Methods ¶
Instance Methods ¶
init(json_definition='')
Creates a new definition, if json_definition
is empty, default values are
used, otherwise the values are read from the given definition.
getFormatString()
→ str
Returns the format string that will be used to build object paths.
isSorted()
→ bool
Returns true if the query has sorting enabled.
isSortReversed()
→ bool
Returns true if the sort order is reversed.
isPartiallySorted()
→ bool
Returns true if the query is partially sorted (i.e. only the first n entries are sorted).
getPartialSortCount()
→ int
For partially sorted queries, return the number of sorted objects.
getFilterArray()
→ list
of pdgd.QueryDefinitionFilter
Returns the list of filters in the query definition.
getPropertyPaths()
→ dict
getPropertyPathsArray()
→ list
of str
Returns a list of object property paths used in the query.
readFromJson(json_definition)
Replace values with those from the json definition.
toJson()
→ str
Returns a json version of the query definition.
addPropertyPath(path)
Adds the object’s property path to the list of paths used by the query.
setFormatString(format_string)
format_string
will be used when building result paths.
setSorted(sorted)
Sets if the results should be sorted or not.
setPartiallySorted(partially_sorted)
For sorted queries, sets if the results only need to be sorted at the beggining of the list.
setSortProperty(sort_property)
Sets the property used for sorting the query.
addFilterArray(filterArray)
Adds a filter array to the query definition.