예제 #1
0
class One(Model):
    _meta = {'_doc_type': 'model_one'}
    _mapping = {
        'id':
        Keyword(name='id'),
        'single':
        SingleJoin(name='single',
                   source='test_connect.One',
                   target='test_connect.Two')
    }
예제 #2
0
class Many(Model):
    __slots__ = ('id', 'value', 'one', 'one_id')

    _meta = {'_doc_type': 'model_many'}
    _mapping = {
        'id':
        Keyword(name='id'),
        'value':
        Keyword(name='value'),
        'one':
        SingleJoin(name='one', source='test_join.Many',
                   target='test_join.One'),
    }
예제 #3
0
class Parent(Model):
    __slots__ = ('id', 'value', 'child')

    _meta = {'_doc_type': 'model_parent'}
    _mapping = {
        'id':
        Keyword(name='id'),
        'value':
        Keyword(name='value'),
        'child':
        SingleJoin(name='child',
                   source='test_join.Parent',
                   target='test_join.Child')
    }
예제 #4
0
class Key(Model):
    __slots__ = ('value', 'user', 'user_id')

    _meta = {'_doc_type': 'model_key'}
    _mapping = {
        'id':
        Keyword(name='id'),
        'value':
        Keyword(name='value'),
        'user':
        SingleJoin(name='user',
                   source='test_join.Key',
                   target='test_join.User'),
    }
예제 #5
0
class IdManyWithReference(Model):
    __slots__ = ('id', 'value', 'one')

    _meta = {'_doc_type': 'model_many_wr'}
    _mapping = {
        'id':
        Keyword(name='id'),
        'value':
        Keyword(name='value'),
        'one':
        SingleJoin(name='one',
                   source='test_join.IdManyWithReference',
                   target='test_join.IdOneWithReference:many'),
    }
예제 #6
0
class SelfJoin(Model):
    __slots__ = ('id', 'value', 'join')

    _meta = {
        '_doc_type': 'model_self_join',
    }
    _mapping = {
        'id':
        Keyword(name='id'),
        'value':
        Keyword(name='value'),
        'join':
        SingleJoin(name='join',
                   source='test_serialize.SelfJoin',
                   target='test.serialize.SelfJoin')
    }