Skip to content

flywheel.finder

Provides finder interface for collections

Finder

Bases: object

Finder wrapper for finding objects in a collection

__call__(*args, **kwargs)

Invoke the underlying get function directly

Parameters:

Name Type Description Default
filter str

The filter to apply. (e.g. label=my-label,created>2018-09-22)

required
sort str

The sort fields and order. (e.g. label:asc,created:desc)

required
limit int

The maximum number of entries to return.

required
skip int

The number of entries to skip.

required
page int

The page number (i.e. skip limit*page entries)

required
after_id str

Paginate after the given id. (Cannot be used with sort, page or skip)

required

__init__(context, method, *args)

Create a new finder object for the given method

Parameters:

Name Type Description Default
context object

The context object (i.e. Flywheel client)

required
method str

The name of the method to invoke (must support pagination)

required
args

Additional arguments to pass to the find function (e.g. id)

()

find(*args, **kwargs)

Find all items in the collection that match the provided filter

Parameters:

Name Type Description Default
args

The list of filters to apply (e.g. 'label=my-label' , 'created>2018-09-22')

()
sort str

The sort fields and order. (e.g. label:asc,created:desc)

required
limit int

The maximum number of entries to return.

required
skip int

The number of entries to skip.

required
page int

The page number (i.e. skip limit*page entries)

required
after_id str

Paginate after the given id. (Cannot be used with sort, page or skip)

required

find_first(*args, **kwargs)

Find the first item matching the provided filter. Returns None if no items matched.

Parameters:

Name Type Description Default
args

The list of filters to apply (e.g. 'label=my-label' , 'created>2018-09-22')

()
sort str

The sort fields and order. (e.g. label:asc,created:desc)

required
limit int

The maximum number of entries to return.

required
skip int

The number of entries to skip.

required
page int

The page number (i.e. skip limit*page entries)

required
after_id str

Paginate after the given id. (Cannot be used with sort, page or skip)

required

find_one(*args, **kwargs)

Find exactly one item matching the provided filter. Raises a ValueError if 0 or 2+ items matched.

Parameters:

Name Type Description Default
args

The list of filters to apply (e.g. 'label=my-label' , 'created>2018-09-22')

()
sort str

The sort fields and order. (e.g. label:asc,created:desc)

required
limit int

The maximum number of entries to return.

required
skip int

The number of entries to skip.

required
page int

The page number (i.e. skip limit*page entries)

required
after_id str

Paginate after the given id. (Cannot be used with sort, page or skip)

required

iter(limit=250)

Iterate over all items in the collection, without limit.

Parameters:

Name Type Description Default
limit int

The number of entries to return per call (default is 250)

250

iter_find(*args, **kwargs)

Find all items in the collection that match the provided filter, without limit.

Parameters:

Name Type Description Default
args

The list of filters to apply (e.g. 'label=my-label' , 'created>2018-09-22')

()
limit int

The number of entries to return per call (default is 250)

required