Example #1
0
        class AutoHashIndexModel1(IndexedRedisModel):
            FIELDS = [
                IRField('name'),
                IRFieldChain('value', [IRField(), IRBase64Field()]),
            ]

            INDEXED_FIELDS = ['name', 'value']

            KEY_NAME = 'TestIRFieldChain__AutoHashIndexModel1'
            class Model_PreMainModel(IndexedRedisModel):
                FIELDS = [
                    IRField('name'),
                    IRField('value'),
                    IRForeignLinkField('main', Model_MainModel),
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'TestIRForeignLinkField__PreMainModel1'
            class Model_MainModelIndexed(IndexedRedisModel):
                FIELDS = [
                    IRField('name'),
                    IRField('value'),
                    IRForeignLinkField('other', Model_RefedModel),
                ]

                INDEXED_FIELDS = ['name', 'other']

                KEY_NAME = 'TestIRForeignLinkField__MainModelIndexed1'
Example #4
0
        class Model_SameFieldsGeneral(IndexedRedisModel):

            FIELDS = [
                IRField('name'),
                IRField('intVal', valueType=int),
                IRPickleField('pickledData'),
            ]

            INDEXED_FIELDS = ['name']

            KEY_NAME = 'TestDiffModels__Model_SameFieldsGeneral1'
        class Model_RefedModel(IndexedRedisModel):

            FIELDS = [
                IRField('name'),
                IRField('strVal'),
                IRField('intVal', valueType=int)
            ]

            INDEXED_FIELDS = ['name']

            KEY_NAME = 'TestIRForeignLinkField__RefedModel1'
Example #6
0
        class Model_DifferentFieldProperty1(IndexedRedisModel):

            FIELDS = [
                IRField('name'),
                IRField('intVal', valueType=bool),
                IRPickleField('pickledData'),
            ]

            INDEXED_FIELDS = ['name']

            KEY_NAME = 'TestDiffModels__Model_DifferentFieldProperty1'
Example #7
0
        class Model_PreMainModel(IndexedRedisModel):
            FIELDS = [
                IRField('name'),
                IRField('strVal'),
                IRField('modelName', defaultValue='PremainModel'),
                IRForeignMultiLinkField('main', Model_MainModel),
            ]

            INDEXED_FIELDS = ['name']

            KEY_NAME = 'TestIRForeignMultiLinkField__PreMainModel1'
Example #8
0
        class Model_DifferentFields1(IndexedRedisModel):

            FIELDS = [
                IRField('name'),
                IRField('blargie', valueType=int),
                IRField('cheese', valueType=bool),
            ]

            INDEXED_FIELDS = ['name']

            KEY_NAME = 'TestDiffModels__Model_DifferentFields1'
Example #9
0
            class Model_ChainIndex(IndexedRedisModel):

                FIELDS = [
                    IRField('name'),
                    IRFieldChain('value',
                                 [IRField(valueType=str),
                                  IRBase64Field()]),
                ]

                INDEXED_FIELDS = ['name', 'value']

                KEY_NAME = 'TestIRFieldChain__ModelChainIndex'
Example #10
0
        class Model_MainModel(IndexedRedisModel):

            FIELDS = [
                IRField('name'),
                IRField('strVal'),
                IRField('modelName', defaultValue='MainModel'),
                IRForeignMultiLinkField('other', Model_RefedModel),
            ]

            INDEXED_FIELDS = ['name', 'other']

            KEY_NAME = 'TestIRForeignMultiLinkField__MainModel1'
Example #11
0
            class Model_IntBase64(IndexedRedisModel):

                FIELDS = [
                    IRField('name'),
                    IRFieldChain('value',
                                 [IRField(valueType=int), IRBase64Field]),
                    IRFieldChain('value2',
                                 [IRField(valueType=int), IRBase64Field],
                                 defaultValue=-1)
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'TestIRFieldChain__IntBase64'
            class Model_FixedPointDefaultValue(IndexedRedisModel):
                FIELDS = [
                    IRField('name'),
                    IRFixedPointField('value', defaultValue=9.91775),
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'TestIRFixedPointField__ModelFixedPointDefaultValue'
Example #13
0
            class Model_CompressedDefaultValue(IndexedRedisModel):
                FIELDS = [
                    IRField('name'),
                    IRCompressedField('value', defaultValue=b'woobley'),
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'TestIRCompressedField__CompressedDefaultValue'
Example #14
0
            class Model_BytesEncoding(IndexedRedisModel):
                FIELDS = [
                    IRField('name'),
                    IRBytesField('value', encoding='utf-8'),
                ]

                INDEXED_FIELDS = ['name', 'value']

                KEY_NAME = 'TestIRBytesField__BytesEncoding'
Example #15
0
            class Model_BytesDefaultValue(IndexedRedisModel):
                FIELDS = [
                    IRField('name'),
                    IRBytesField('value', defaultValue=b'woobley'),
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'TestIRBytesField__ModelBytesDefaultValue'
            class Model_IndexFixedPoint(IndexedRedisModel):
                FIELDS = [
                    IRField('name'),
                    IRFixedPointField('value', defaultValue=irNull),
                    IRFixedPointField('value2', defaultValue=1.11),
                ]

                INDEXED_FIELDS = ['name', 'value', 'value2']

                KEY_NAME = 'TestIRFixedPointField__IndexFixedPoint'
            class Model_UnicodeDefaultValue(IndexedRedisModel):
                
                FIELDS = [
                    IRField('name'),
                    IRUnicodeField('value', defaultValue=u'qqq', encoding='utf-8'),
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'TestIRUnicodeField__UnicodeDefaultValue'
Example #18
0
            class Model_IndexBytes(IndexedRedisModel):
                FIELDS = [
                    IRField('name'),
                    IRBytesField('value', defaultValue=irNull),
                    IRBytesField('value2', defaultValue=b'xxx'),
                ]

                INDEXED_FIELDS = ['name', 'value', 'value2']

                KEY_NAME = 'TestIRBytesField__IndexBytes'
Example #19
0
            class Model_GeneralCompressed(IndexedRedisModel):

                FIELDS = [
                    IRField('name'),
                    IRCompressedField('value', defaultValue=irNull),
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'TestIRCompressedField__GeneralCompressed'
Example #20
0
            class Model_RawValue(IndexedRedisModel):

                FIELDS = [
                    IRField('name'),
                    IRRawField('value'),
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'TestIRRawField__ModelRawValue'
            class Model_GeneralUnicode(IndexedRedisModel):
                
                FIELDS = [
                    IRField('name'),
                    IRUnicodeField('value', defaultValue=irNull, encoding='utf-8'),
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME='TestIRUnicodeField__GeneralUnicode'
Example #22
0
                class Model_CompressLzma(IndexedRedisModel):
                    FIELDS = [
                        IRField('name'),
                        IRCompressedField('value',
                                          compressMode='lzma',
                                          defaultValue=irNull),
                    ]

                    INDEXED_FIELDS = ['name']

                    KEY_NAME = 'TestIRCompressedField__CompressLzma'
            class Model_Utf16(IndexedRedisModel):
                
                FIELDS = [
                    IRField('name'),
                    IRUnicodeField('value', encoding='utf-16', defaultValue=irNull),
                    IRUnicodeField('value2', encoding='utf-16', defaultValue=''),
                ]

                INDEXED_FIELDS = ['name', 'value']

                KEY_NAME='TestIRUnicodeField__ModelUtf16'
Example #24
0
        class BadModel1(IndexedRedisModel):

            FIELDS = [
                IRField('name'),
                IRFieldChain(
                    'value',
                    [IRPickleField(), IRCompressedField()])
            ]

            INDEXED_FIELDS = ['name', 'value']

            KEY_NAME = 'TestIRFieldChain__BadModel1'
Example #25
0
            class Model_Utf16Compression(IndexedRedisModel):

                FIELDS = [
                    IRField('name'),
                    IRFieldChain('value', [
                        IRUnicodeField(encoding='utf-16'),
                        IRCompressedField()
                    ]),
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'TestIRFieldChain__Utf16Compression'
            class Model_DecimalPlaces(IndexedRedisModel):
                FIELDS = [
                    IRField('name'),
                    IRFixedPointField('value1', decimalPlaces=1),
                    IRFixedPointField('value4', decimalPlaces=4),
                    IRFixedPointField('value9', decimalPlaces=9),
                    IRFixedPointField('value4MoreDef',
                                      decimalPlaces=4,
                                      defaultValue=5.123456),
                ]

                INDEXED_FIELDS = ['name', 'value1', 'value4', 'value9']

                KEY_NAME = 'TestIRFixedPointField__DecimalPlaces'
Example #27
0
            class Model_CompressPickle(IndexedRedisModel):

                FIELDS = [
                    IRField('name'),
                    IRFieldChain(
                        'value',
                        [IRPickleField(), IRCompressedField()]),
                    IRFieldChain(
                        'value2',
                        [IRPickleField(), IRCompressedField()],
                        defaultValue=['a', 'b', 'c'])
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'TestIRFieldChain__ModelCompressPickle'
Example #28
0
            class Model_Base64Unicode(IndexedRedisModel):

                FIELDS = [
                    IRField('name'),
                    IRFieldChain('value', [
                        IRUnicodeField(encoding='utf-8'),
                        IRBase64Field(encoding='utf-8')
                    ],
                                 defaultValue=irNull),
                    IRFieldChain('value2', [
                        IRUnicodeField(encoding='utf-8'),
                        IRBase64Field(encoding='utf-8')
                    ],
                                 defaultValue='qqz'),
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'TestIRFieldChain__ModelBase64Unicode'
Example #29
0
class NetFetchCompressedBzip2File(NetFetchFile):
    '''
        NetFetchCompressedBzip2File - Used for bzip2 compression on a NetFetchFile
    '''

    NETFETCH_TYPE = NETFETCH_TYPE_COMPRESSED_BZIP2

    FIELDS = [
        IRField('filename'),
        IRField('hostname'),
        IRField('checksum'),
        IRField('encrypted'),
        IRField('mode'),
        IRField('owner'),
        IRField('group'),
        IRField('netfetchType',
                valueType=int,
                defaultValue=NETFETCH_TYPE_COMPRESSED_BZIP2),
        IRFieldChain('data',
                     [IRBytesField(),
                      IRCompressedField(compressMode='bzip2')]),
    ]
Example #30
0
            class Model_CompressedIndex(IndexedRedisModel):
                FIELDS = [IRField('name'), IRCompressedField('value')]

                INDEXED_FIELDS = ['name', 'value']

                KEY_NAME = 'TestIRCompressedField__CompressedIndex'