flywheel.fields.conditions module

Query constraints

class flywheel.fields.conditions.Condition[source]

Bases: object

A constraint that will be applied to a query or scan


eq_fields (dict) Mapping of field name to field value
fields (dict) Mapping of field name to (operator, value) tuples
limit (int or dynamo3.Limit) Maximum number of results
scan_limit (int) Maximum number of items to scan in DynamoDB
index_name (str) Name of index to use for a query
classmethod construct(field, op, other)[source]

Create a Condition on a field


field : str

Name of the field to constrain

op : str

Operator, such as ‘eq’, ‘lt’, or ‘contains’

other : object

The value to constrain the field with


condition : Condition

classmethod construct_index(name)[source]

Force the query to use a certain index

Parameters:name : str
Returns:condition : Condition
classmethod construct_limit(count)[source]

Create a condition that will limit the results to a count

Parameters:count : int
Returns:condition : Condition
classmethod construct_scan_limit(count)[source]

Create a condition that will limit the number of items scanned

Parameters:count : int
Returns:condition : Condition

Get the kwargs for doing a table query


Get the kwargs for doing a table scan