swimlane.core.resources.report module

class swimlane.core.resources.report.Report(*args, **kwargs)[source]

Bases: APIResource, PaginatedCursor

A report class used for searching

Can be iterated over to retrieve results

Notes

Record retrieval is lazily evaluated and cached internally, adding a filter and attempting to iterate again will not respect the additional filter and will return the same set of records each time

Examples

Lazy retrieval of records with direct iteration over report

report = app.reports.build('new-report')
report.filter('field_1', 'equals', 'value')

for record in report:
    do_thing(record)

Full immediate retrieval of all records

report = app.reports.build('new-report')
report.filter('field_1', 'doesNotEqual', 'value')

records = list(report)
name

Report name

Type:

str

Keyword Arguments:
  • limit (int) – Max number of records to return from report/search

  • page_size (int) – Max number of records per page

  • keywords (list(str)) – List of keywords to use in report/search

default_limit = 50
filter(field_name, operand, value)[source]

Adds a filter to report

Notes

  1. All filters are currently AND’ed together.

  2. None values work like a wildcard and will skip type verification.

Parameters:
  • field_name (str) – Target field name to filter on

  • operand (str) – Operand used in comparison. See swimlane.core.search for options

  • value – Target value used in comparison

filter_type(filter_type)[source]
get_default_value(value, field_type)[source]
get_field_list_type(field_type)[source]
parse_field_value(field, value)[source]
set_columns(*field_names)[source]

Set specified columns for report

Notes

The Tracking Id column is always included

Parameters:

*field_names (str) – Zero or more column names

sort(field_name, order)[source]

Adds a sort to report

Parameters:
  • field_name (str) – Target field name to sort by

  • order (str) – Sort order

validateOperator(operator)[source]
validate_type(value, type, type_name=None)[source]
swimlane.core.resources.report.report_factory(app, report_name, **kwargs)[source]

Report instance factory populating boilerplate raw data

Parameters:
  • app (App) – Swimlane App instance

  • report_name (str) – Generated Report name

Keyword Args

**kwargs: Kwargs to pass to the Report class