l.b.m.bugtask : module documentation

Part of lp.bugs.model

Classes that implement IBugTask and its related interfaces.
Function bugtask_sort_key A sort key for a set of bugtasks. We want:
Function bug_target_from_key Returns the IBugTarget defined by the given DB column values.
Function bug_target_to_key Returns the DB column values for an IBugTarget.
Class BugTaskDelta See IBugTaskDelta.
Function BugTaskToBugAdapter Adapt an IBugTask to an IBug.
Class PassthroughValue A wrapper to allow setting values on conjoined bug tasks.
Function validate_conjoined_attribute Undocumented
Function validate_status Undocumented
Function map_status_for_storage Undocumented
Function validate_assignee Undocumented
Function validate_target Validate a bugtask target against a bug's existing tasks.
Function validate_new_target Validate a bugtask target to be added.
Class BugTask See IBugTask.
Class BugTaskSet See IBugTaskSet.
def bugtask_sort_key(bugtask):

A sort key for a set of bugtasks. We want:

  • products first, followed by their productseries tasks
  • distro tasks, followed by their distroseries tasks
  • ubuntu first among the distros
def bug_target_from_key(product, productseries, distribution, distroseries, sourcepackagename):
Returns the IBugTarget defined by the given DB column values.
def bug_target_to_key(target):
Returns the DB column values for an IBugTarget.
def BugTaskToBugAdapter(bugtask):
Adapt an IBugTask to an IBug.
@block_implicit_flushes
def validate_conjoined_attribute(self, attr, value):
Undocumented
def validate_status(self, attr, value):
Undocumented
def map_status_for_storage(bug, status, when=None):
Undocumented
def validate_assignee(self, attr, value):
Undocumented
def validate_target(bug, target, retarget_existing=True, check_source_package=True):
Validate a bugtask target against a bug's existing tasks.

Checks that no conflicting tasks already exist.

If the target is a source package, we need to check that it has been published in the distribution since we don't trust the vocabulary to enforce this. However, when using the UI, this check is done during the validation stage of form submission and we don't want to do it again since it uses an expensive query. So 'check_source_package' can be set to False.

def validate_new_target(bug, target, check_source_package=True):
Validate a bugtask target to be added.

Make sure that the isn't already a distribution task without a source package, or that such task is added only when the bug doesn't already have any tasks for the distribution.

The same checks as validate_target does are also done.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.