swimlane.core.fields.reference module

class swimlane.core.fields.reference.ReferenceCursor(*args, **kwargs)[source]

Bases: FieldCursor

Handles lazy retrieval of target records

add(record)[source]

Add a reference to the provided record

remove(record)[source]

Remove a reference to the provided record

property target_app

Make field’s target_app available on cursor

class swimlane.core.fields.reference.ReferenceField(*args, **kwargs)[source]

Bases: CursorField

cast_to_report(value)[source]

Cast single value to report format, defaults to cast_to_swimlane(value)

cursor_class

alias of ReferenceCursor

field_type = 'Core.Models.Fields.Reference.ReferenceField, Core'
for_json()[source]

Return list of all cursor items, calling .for_json() if available for best representations

get_batch_representation()[source]

Return best batch process representation of field value

get_item()[source]

Return cursor if multi-select, direct value if single-select

get_swimlane()[source]

Return list of record ids

set_python(value)[source]

With changes to Lazy instrumentation _evaluation returns SortedDictionary, unfortunately this is still public method that can be accessed in the old way, therefore it was split in two.

set_python_old(value)[source]

Expect list of record instances, convert to a SortedDict for internal representation

set_python_raw(value)[source]
set_swimlane(value)[source]

Store record ids in separate location for later use, but ignore initial value

supported_types = (<class 'swimlane.core.resources.record.Record'>,)
property target_app

Defer target app retrieval until requested

validate_value(value)[source]

Validate provided record is a part of the appropriate target app for the field