Function | search_value_to_storm_where_condition | Convert a search value to a Storm WHERE condition. |
Function | search_bugs | Return a ResultSet of BugTasks for the given search parameters. |
Function | get_bug_privacy_filter | An SQL filter for search results that adds privacy-awareness. |
Function | get_bug_privacy_filter_terms | Return Storm terms for filtering bugs by visibility. |
Function | get_bug_bulk_privacy_filter_terms | Return Storm terms for filtering people by bug visibility. |
Function | _build_origin | Build the parameter list for Store.using(). |
Function | _build_query | Build and return an SQL query with the given parameters. |
Function | _process_order_by | Process the orderby parameter supplied to search(). |
Function | _require_params | Undocumented |
Function | _build_search_text_clause | Build the clause for searchtext. |
Function | _build_status_clause | Return the SQL query fragment for search by status. |
Function | _build_exclude_conjoined_clause | Exclude bugtasks with a conjoined master. |
Function | _build_hardware_related_clause | Hardware related SQL expressions and tables for bugtask searches. |
Function | _build_blueprint_related_clause | Find bugs related to Blueprints, or not. |
Function | _build_pending_bugwatch_elsewhere_clause | Return a clause for BugTaskSearchParams.pending_bugwatch_elsewhere |
Function | _build_no_upstream_bugtask_clause | Return a clause for BugTaskSearchParams.has_no_upstream_bugtask. |
Function | _build_open_or_resolved_upstream_clause | Return a clause for BugTaskSearchParams.open_upstream or |
Function | _build_open_upstream_clause | Return a clause for BugTaskSearchParams.open_upstream. |
Function | _build_resolved_upstream_clause | Return a clause for BugTaskSearchParams.open_upstream. |
Function | _build_upstream_clause | Return an clause for returning upstream data if the data exists. |
Function | _build_tag_set_query | Undocumented |
Function | _build_tag_set_query_all | Return a Storm expression for bugs matching all given tags. |
Function | _build_tag_set_query_any | Return a Storm expression for bugs matching any given tag. |
Function | _build_tag_search_clause | Return a tag search clause. |
Function | _nocache_bug_decorator | A pass through decorator for consistency. |
Function | _make_cache_user_can_view_bug | Curry a decorator for bugtask queries to cache permissions. |
Function | _get_bug_privacy_filter_with_decorator | Return a SQL filter to limit returned bug tasks. |
Parameters | pre_iter_hook | An optional pre-iteration hook used for eager loading bug targets for list views. |
alternatives | A sequence of BugTaskSearchParams instances, the results of which will be unioned. Only the first ordering is respected. | |
just_bug_ids | Return a ResultSet of bug IDs instead of BugTasks. |
Tables may appear simultaneously in join_tables and in clauseTables. This method ensures that each table appears exactly once in the returned sequence.
Parameters | join_tables | A sequence of tables that should be joined as returned by _build_query(). Each element has the form (table, join), where table is the table to join and join is a Storm Join or LeftJoin instance. |
clauseTables | A sequence of tables that should appear in the FROM clause of a query. The join condition is defined in the WHERE clause. |
Also return the clauseTables and orderBy for the generated query.
Returns | A query, the tables to query, ordering expression and a decorator to call on each returned row. |
This method ensures the sort order will be stable, and converting the string supplied to actual column names.
Returns | A Storm order_by tuple. |
Called from _build_query
or recursively.
This search option only makes sense when searching for bugtasks for a milestone. Only bugtasks for a project or a distribution can have a conjoined master bugtask, which is a bugtask on the project's development focus series or the distribution's currentseries. The project bugtask or the distribution bugtask will always have the same milestone set as its conjoined master bugtask, if it exists on the bug. Therefore, this prevents a lot of bugs having two bugtasks listed in the results. However, it is ok if a bug has multiple bugtasks in the results as long as those other bugtasks are on other series.
Device related WHERE clauses are returned if params.hardware_bus, params.hardware_vendor_id, params.hardware_product_id are all not None.
Parameters | params | A BugTaskSearchParams instance. |
Returns | (tables, clauses) where clauses is a list of SQL expressions which limit a bugtask search to bugs related to a device or driver specified in search_params. If search_params contains no hardware related data, empty lists are returned. |
This method will handles BugTasks that do not have upstream BugTasks as well as thoses that do.
Parameters | tags | An iterable of valid tags without - or + and not wildcards. |
Returns | A Storm expression or None if no tags were provided. |
Parameters | tags | An iterable of valid tags without - or + and not wildcards. |
Returns | A Storm expression or None if no tags were provided. |
Parameters | tags_spec | An instance of any or all containing tag
"specifications". A tag specification is a valid tag name
optionally prefixed by a minus sign (denoting "not"), or an
asterisk (denoting "any tag"), again optionally prefixed by a
minus sign (and thus denoting "not any tag"). |
See Also | _get_bug_privacy_filter_with_decorator |
See Also | _get_bug_privacy_filter_with_decorator |
Parameters | user | The user whose visible bugs will be filtered. |
Returns | A SQL filter, a decorator to cache visibility in a resultset that returns BugTask objects. |
The same rules as get_bug_bulk_privacy_filter_terms, except designed and optimised for cases like bug searches, where we have a small number of users and a lot of bugs.
Also unlike get_bug_bulk_privacy_filter_terms, this constrains BugTaskFlat to user, rather than user to a bug column. It's up to callsites to work with BugTaskFlat.
Parameters | user | a Person ID value or column reference. |
check_admin | add an admin role check. This is probably only necessary when checking multiple users; if you're only checking a specific one, you can do the admin check beforehand. | |
Returns | a Storm expression relating person to bug, where bug is visible to person. |
The same rules as get_bug_privacy_filter_terms, except that it's designed and optimised for cases like bug notifications, where we have a small number of bug and need to check which people can see them.
Parameters | person | a Person ID value or column reference. |
bug | a Bug ID value or column reference. | |
Returns | a Storm expression relating person to bug, where bug is visible to person. |