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 | toTerm | Undocumented |
Method | getTermByToken | See zope.schema.interfaces.IVocabularyTokenized . |
Method | search | See SQLObjectVocabularyBase.search . |
Method | __iter__ | Return an iterator which provides the terms from the vocabulary. |
Method | __contains__ | Undocumented |
Method | _is_valid_candidate | Is spec a valid candidate spec for self.context? |
Method | _order_by | Look at the context to provide grouping. |
Method | _exclude_blocked_query | Return the select statement to exclude already blocked specs. |
Method | _spec_from_url | If url is the URL of a specification, return it. |
Inherited from SQLObjectVocabularyBase:
Method | __init__ | Undocumented |
Method | searchForTerms | Undocumented |
Method | __len__ | Undocumented |
Method | getTerm | Undocumented |
Method | emptySelectResults | Return a SelectResults object without any elements. |
Inherited from FilteredVocabularyBase (via SQLObjectVocabularyBase):
Method | __getattribute__ | Undocumented |
Method | supportedFilters | Undocumented |
spec
a valid candidate spec for self.context?
Invalid candidates are:
- None
- 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.
url
is 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).
zope.schema.interfaces.IVocabularyTokenized
.
The tokens for specifications are either the name of a spec on the same target or a URL for a spec.
SQLObjectVocabularyBase.search
.
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
_filter_specs
.