l.s.x.i.IXRefSet(Interface) : interface documentation

Part of lp.services.xref.interfaces View In Hierarchy

Manager of cross-references between objects.

Each participant in an xref has an "object ID": a tuple of (str type, str id).

All xrefs are currently between local objects, so links always exist in both directions, but this can't be assumed to hold in future.

Method create Create cross-references.
Method findFromMany Find all cross-references from multiple objects.
Method delete Delete cross-references.
Method findFrom Find all cross-references from an object.
def create(xrefs):
Create cross-references.

Back-links are automatically created.

:param xrefs: A dict of
    {from_object_id: {to_object_id:
        {'creator': `IPerson`, 'date_created': `datetime`,
         'metadata': value}}}.
    The creator, date_created, and metadata keys are optional.
def findFromMany(object_ids, types=None):
Find all cross-references from multiple objects.

:param object_ids: A collection of object IDs.
:param types: An optional collection of the types to include.
:return: A dict of
    {from_object_id: {to_object_id:
        {'creator': `IPerson`, 'date_created': `datetime`,
         'metadata': value}}}.
    The creator, date_created, and metadata keys are optional.
def delete(xrefs):
Delete cross-references.

Back-links are automatically deleted.

ParametersxrefsA dict of {from_object_id: [to_object_id]}.
def findFrom(object_id, types=None):
Find all cross-references from an object.

:param object_id: An object ID.
:param types: An optional collection of the types to include.
:return: A dict of
    {to_object_id:
        {'creator': `IPerson`, 'date_created': `datetime`,
         'metadata': value}}.
    The creator, date_created, and metadata keys are optional.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.