示例#1
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'
示例#2
0
            class TestCopyModel_CopyInstance(IndexedRedisModel):
                FIELDS = [
                    IRField('name'),
                    IRPickleField('tags'),
                ]

                INDEXED_FIELDS = ['name']

                KEY_NAME = 'IRTestCopyModel__CopyInstance'
示例#3
0
        class Model_DifferentFieldProperty1(IndexedRedisModel):

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

            INDEXED_FIELDS = ['name']

            KEY_NAME = 'TestDiffModels__Model_DifferentFieldProperty1'
示例#4
0
        class Model_SameFieldsGeneral(IndexedRedisModel):

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

            INDEXED_FIELDS = ['name']

            KEY_NAME = 'TestDiffModels__Model_SameFieldsGeneral1'
示例#5
0
        class BadModel1(IndexedRedisModel):

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

            INDEXED_FIELDS = ['name', 'value']

            KEY_NAME = 'TestIRFieldChain__BadModel1'
示例#6
0
class MyPickleModel(IndexedRedisModel):

    FIELDS = [ \
        IRField('name'),
        IRPickleField('timestamp'),
    ]

    INDEXED_FIELDS = [ \
        'name',
    #        'timestamp',
    ]

    KEY_NAME = 'MyPickleModel'
示例#7
0
            class SimpleIRFieldModel(IndexedRedisModel):

                FIELDS = [ IRField('name'), IRPickleField('data') ]
                INDEXED_FIELDS = ['name']

                KEY_NAME = 'Test_SimpleIRPickleFieldModel'