示例#1
0
class FriendModel(BaseModel):
    """
    A model for testing
    """
    Type = UnicodeAttribute(default='friend')
    Name = UnicodeAttribute(null=True)
    Description = UnicodeAttribute(null=True)
    CreatedAt = UTCDateTimeAttribute(default=datetime.utcnow())
示例#2
0
class TypeIndex(GlobalSecondaryIndex):
    """ Type Index """
    class Meta: # pylint: disable=too-few-public-methods
        """ GSI properties """
        index_name = 'Type'
        projection = AllProjection()
    Type = UnicodeAttribute(default='person', hash_key=True)
    sk = UnicodeAttribute(range_key=True)
示例#3
0
class BaseModel(Model):
    '''Base model with meta'''
    class Meta(Model.Meta):
        ''' Table properties '''
        table_name = os.environ.get('DYNAMODB_TABLE')
    PK = UnicodeAttribute(hash_key=True)
    SK = UnicodeAttribute(range_key=True)
    TypeIndex = TypeIndex()
示例#4
0
class TypeIndex(GlobalSecondaryIndex):
    class Meta:
        index_name = 'Type'
        billing_mode = 'PAY_PER_REQUEST'
        projection = AllProjection()

    Type = UnicodeAttribute(default='project', hash_key=True)
    SK = UnicodeAttribute(range_key=True)
示例#5
0
class Person(BaseModel):
    Type = UnicodeAttribute(default='person')
    FirstName = UnicodeAttribute()
    LastName = UnicodeAttribute()
    Age = NumberAttribute(default=0)
    CreateDate = UTCDateTimeAttribute(attr_name='CreateDateTime')
    ValueList = ListAttribute()
    ValueMap = MapAttribute()
    DoesNotExist = DoesNotExist
示例#6
0
class FriendToUpdate(BaseModel):
    '''
    A model for a friend that has lots of fun things to update
    '''
    Type = UnicodeAttribute(default='update_friend')
    NumberAttr = NumberAttribute(null=True)
    SetAttr = UnicodeSetAttribute(null=True)
    ListAttr = ListAttribute(null=True)
    StringAttr = UnicodeAttribute(null=True)
示例#7
0
class BaseModel(Model):
    '''Base model with meta'''
    class Meta(Model.Meta):
        table_name = 'falcano-e2e'
        billing_mode = 'PAY_PER_REQUEST'

    PK = UnicodeAttribute(hash_key=True)
    SK = UnicodeAttribute(range_key=True)
    TypeIndex = TypeIndex()
示例#8
0
        class MyModel(Model):
            class Meta(Model.Meta):
                table_name = 'falcano-map-attr-e2e'
                billing_mode = 'PAY_PER_REQUEST'

            PK = UnicodeAttribute(hash_key=True)
            SK = UnicodeAttribute(range_key=True)
            outer_map = OuterMapAttribute()
            outer_list = ListAttribute()
            Type = UnicodeAttribute(default='test_nested_map')
示例#9
0
class TestModel(Model):
    '''Test model with meta'''
    class Meta(Model.Meta):
        table_name = 'falcano-map-attr-e2e'
        billing_mode = 'PAY_PER_REQUEST'

    PK = UnicodeAttribute(hash_key=True)
    SK = UnicodeAttribute(range_key=True)
    Data = MapAttribute()
    Type = UnicodeAttribute(default='test_map_attribute')
示例#10
0
class Person(BaseModel):
    Type = UnicodeAttribute(default='person')
    FirstName = UnicodeAttribute()
    LastName = UnicodeAttribute()
    Age = NumberAttribute()
    DoesNotExist = DoesNotExist
示例#11
0
class TestCustomAttrMap(MapAttribute):
    overridden_number_attr = NumberAttribute(attr_name="number_attr")
    overridden_unicode_attr = UnicodeAttribute(attr_name="unicode_attr")
示例#12
0
 class MyModel(Model):
     key = UnicodeAttribute(hash_key=True)
     outer_map = OuterMapAttribute()
示例#13
0
class TestDefaultsMap(MapAttribute):
    map_field = MapAttribute(default={})
    string_field = UnicodeAttribute(null=True)
示例#14
0
class FriendGroup(BaseModel):
    '''
    A model for a friendgroup
    '''
    Type = UnicodeAttribute(default='friend_group')
    Name = UnicodeAttribute(null=True)