Part of lp.blueprints.vocabularies.specificationdependency View In Hierarchy
This includes only those specs that are not blocked by this spec (directly or indirectly), unless they are already dependencies.
This vocabulary has a bit of a split personality.
Tokens are either:
- the name of a spec, in which case it must be a spec on the same target as the context, or
- the full URL of the spec, in which case it can be any spec at all.
For the purposes of enumeration and searching we look at all the possible specifications, but order those of the same target first. If there is an associated series as well, then those are shown before other matches not linked to the same series.
|Method||__iter__||Return an iterator which provides the terms from the vocabulary.|
|Method||_order_by||Look at the context to provide grouping.|
|Method||_exclude_blocked_query||Return the select statement to exclude already blocked specs.|
Inherited from SQLObjectVocabularyBase:
|Method||emptySelectResults||Return a SelectResults object without any elements.|
speca valid candidate spec for self.context?
Invalid candidates are:
- The spec that we're adding a depdency to
- Specs that depend on this one
Preventing the last category prevents loops in the dependency graph.
If the blueprint is for a project, then matching results for that project should be first. If the blueprint is set for a series, then that series should come before others for the project. Similarly for the distribution, and the series goal for the distribution.
If all else is equal, the ordering is by name, then database id as a final uniqueness resolver.
urlis the URL of a specification, return it.
This implementation is a little fuzzy and will return specs for URLs that, for example, don't have the host name right. This seems unlikely to cause confusion in practice, and being too anal probably would be confusing (e.g. not accepting production URLs on staging).
The tokens for specifications are either the name of a spec on the same target or a URL for a spec.
We find specs where query is in the text of name or title, or matches
the full text index and then filter out ineligible specs using