Part of lp.app.browser.tales View In Hierarchy
Known subclasses: lp.app.browser.tales.ArchiveFormatterAPI, lp.app.browser.tales.BranchMergeProposalFormatterAPI, lp.app.browser.tales.BranchSubscriptionFormatterAPI, lp.app.browser.tales.BugBranchFormatterAPI, lp.app.browser.tales.BugFormatterAPI, lp.app.browser.tales.BugTaskFormatterAPI, lp.app.browser.tales.CodeImportFormatterAPI, lp.app.browser.tales.CodeImportMachineFormatterAPI, lp.app.browser.tales.CodeReviewCommentFormatterAPI, lp.app.browser.tales.DistroSeriesFormatterAPI, lp.app.browser.tales.GitRefFormatterAPI, lp.app.browser.tales.GitRepositoryFormatterAPI, lp.app.browser.tales.LiveFSFormatterAPI, lp.app.browser.tales.MilestoneFormatterAPI, lp.app.browser.tales.PillarFormatterAPI, lp.app.browser.tales.ProductReleaseFormatterAPI, lp.app.browser.tales.ProductSeriesFormatterAPI, lp.app.browser.tales.QuestionFormatterAPI, lp.app.browser.tales.SnapFormatterAPI, lp.app.browser.tales.SnappySeriesFormatterAPI, lp.app.browser.tales.SourcePackageRecipeFormatterAPI, lp.app.browser.tales.SourcePackageReleaseFormatterAPI, lp.app.browser.tales.SpecificationBranchFormatterAPI, lp.app.browser.tales.SpecificationFormatterAPI, lp.registry.browser.distributionsourcepackage.DistributionSourcePackageFormatterAPI, lp.registry.browser.sourcepackage.SourcePackageFormatterAPI
This provides fmt:url and fmt:link support for the object it adapts.
For most object types, only the _link_summary_template class variable and _link_summary_values method need to be overridden. This assumes that:
- canonical_url produces appropriate urls for this type,
- the launchpad.View permission alone is required to view this object's url, and,
- if there is an icon for this object type, image:icon is implemented and appropriate.
For greater control over the summary, overrride _make_link_summary.
If a different permission is required, override _link_permission.
Method | sprite_css | Retrieve the icon for the _context, if any. |
Method | link | Return html including a link, description and icon. |
Method | _link_summary_values | Return a dict of values to use for template substitution. |
Method | _make_link_summary | Create a summary from _template and _link_summary_values(). |
Method | _title_values | Return a dict of values to use for template substitution. |
Method | _make_title | Create a title from _title_template and _title_values(). |
Inherited from ObjectFormatterAPI:
Method | __init__ | Undocumented |
Method | url | Return the object's canonical URL. |
Method | api_url | Return the object's (partial) canonical web service URL. |
Method | traverse | Traverse the specified path, processing any optional parameters. |
Method | global_css | Undocumented |
Method | pagetitle | The page title to be used. |
Method | _getSaneBreadcrumbDetail | Undocumented |
These values should not be escaped, as this will be performed later. For this reason, only string values should be supplied.
This summary is for use in fmt:link, which is meant to be used in contexts like lists of items.
These values should not be escaped, as this will be performed later. For this reason, only string values should be supplied.
This title is for use in fmt:link, which is meant to be used in contexts like lists of items.
Returns | The icon css or None if no icon is available. |
Icon and link are optional, depending on type and permissions. Uses self._make_link_summary for the summary, self._get_icon for the icon, self._should_link to determine whether to link, and self.url() to generate the url.