Submit
Path:
~
/
/
usr
/
lib
/
python2.7
/
site-packages
/
boto
/
dynamodb2
/
File Content:
fields.pyo
� �Wc @ s d d l m Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e e f d � � YZ d S( i����( t STRINGt BaseSchemaFieldc B s2 e Z d Z d Z e d � Z d � Z d � Z RS( s� An abstract class for defining schema fields. Contains most of the core functionality for the field. Subclasses must define an ``attr_type`` to pass to DynamoDB. c C s | | _ | | _ d S( sN Creates a Python schema field, to represent the data to pass to DynamoDB. Requires a ``name`` parameter, which should be a string name of the field. Optionally accepts a ``data_type`` parameter, which should be a constant from ``boto.dynamodb2.types``. (Default: ``STRING``) N( t namet data_type( t selfR R ( ( s9 /usr/lib/python2.7/site-packages/boto/dynamodb2/fields.pyt __init__ s c C s i | j d 6| j d 6S( s� Returns the attribute definition structure DynamoDB expects. Example:: >>> field.definition() { 'AttributeName': 'username', 'AttributeType': 'S', } t AttributeNamet AttributeType( R R ( R ( ( s9 /usr/lib/python2.7/site-packages/boto/dynamodb2/fields.pyt definition s c C s i | j d 6| j d 6S( s� Returns the schema structure DynamoDB expects. Example:: >>> field.schema() { 'AttributeName': 'username', 'KeyType': 'HASH', } R t KeyType( R t attr_type( R ( ( s9 /usr/lib/python2.7/site-packages/boto/dynamodb2/fields.pyt schema- s N( t __name__t __module__t __doc__t NoneR R R R R ( ( ( s9 /usr/lib/python2.7/site-packages/boto/dynamodb2/fields.pyR s t HashKeyc B s e Z d Z d Z RS( s� An field representing a hash key. Example:: >>> from boto.dynamodb2.types import NUMBER >>> HashKey('username') >>> HashKey('date_joined', data_type=NUMBER) t HASH( R R R R ( ( ( s9 /usr/lib/python2.7/site-packages/boto/dynamodb2/fields.pyR @ s t RangeKeyc B s e Z d Z d Z RS( s� An field representing a range key. Example:: >>> from boto.dynamodb2.types import NUMBER >>> HashKey('username') >>> HashKey('date_joined', data_type=NUMBER) t RANGE( R R R R ( ( ( s9 /usr/lib/python2.7/site-packages/boto/dynamodb2/fields.pyR N s t BaseIndexFieldc B s) e Z d Z d � Z d � Z d � Z RS( s� An abstract class for defining schema indexes. Contains most of the core functionality for the index. Subclasses must define a ``projection_type`` to pass to DynamoDB. c C s | | _ | | _ d S( N( R t parts( R R R ( ( s9 /usr/lib/python2.7/site-packages/boto/dynamodb2/fields.pyR c s c C s? g } x2 | j D]'