flywheel.fields.types module¶
Field type definitions
-
class
flywheel.fields.types.
BinaryType
[source]¶ Bases:
flywheel.fields.types.TypeDefinition
Binary strings, stored as a str/bytes
-
class
flywheel.fields.types.
BoolType
[source]¶ Bases:
flywheel.fields.types.TypeDefinition
Boolean type
-
class
flywheel.fields.types.
DateTimeType
[source]¶ Bases:
flywheel.fields.types.TypeDefinition
Datetimes, stored as a unix timestamp
-
class
flywheel.fields.types.
DateType
[source]¶ Bases:
flywheel.fields.types.TypeDefinition
Dates, stored as timestamps
-
class
flywheel.fields.types.
DecimalType
[source]¶ Bases:
flywheel.fields.types.TypeDefinition
Numerical values that use Decimal in the application layer.
This should be used if you want to work with floats but need the additional precision of the Decimal type.
-
class
flywheel.fields.types.
DictType
[source]¶ Bases:
flywheel.fields.types.TypeDefinition
Dict type, stored as a map
-
class
flywheel.fields.types.
FloatType
[source]¶ Bases:
flywheel.fields.types.TypeDefinition
Float values
-
class
flywheel.fields.types.
IntType
[source]¶ Bases:
flywheel.fields.types.TypeDefinition
Integer values (includes longs)
-
class
flywheel.fields.types.
ListType
[source]¶ Bases:
flywheel.fields.types.TypeDefinition
List type
-
class
flywheel.fields.types.
NumberType
[source]¶ Bases:
flywheel.fields.types.TypeDefinition
Any kind of numerical value
-
class
flywheel.fields.types.
SetType
(item_type=None, type_class=None)[source]¶ Bases:
flywheel.fields.types.TypeDefinition
Set types
-
class
flywheel.fields.types.
StringType
[source]¶ Bases:
flywheel.fields.types.TypeDefinition
String values, stored as unicode
-
class
flywheel.fields.types.
TypeDefinition
[source]¶ Bases:
flywheel.compat.UnicodeMixin
Base class for all Field types
Attributes
data_type (object) The value you wish to pass in to Field as the data_type. aliases (list) Other values that will reference this type if passed to Field ddb_data_type ({STRING, BINARY, NUMBER, STRING_SET, BINARY_SET, NUMBER_SET, BOOL, LIST, MAP}) The DynamoDB data type that backs this type mutable (bool) If True, flywheel will track updates to this field automatically when making calls to sync() allowed_filters (set) The set of filters that can be used on this field type -
coerce
(value, force)[source]¶ Check the type of a value and possible convert it
Parameters: value : object
The value to check
force : bool
If True, always attempt to convert a bad type to the correct type
Returns: value : object
A variable of the correct type
Raises: exc : TypeError or ValueError
If the value is the incorrect type and could not be converted
-
-
class
flywheel.fields.types.
UTCTimezone
[source]¶ Bases:
datetime.tzinfo
UTC