Exemplo n.º 1
0
 class Foo(TestRedisModel):
     namespace = 'related-to-self'
     myself = FKStringField('self')
Exemplo n.º 2
0
 class C(M):
     database = db2
     b = FKStringField(
         B,
         related_name='c_set')  # link to a model on another database !
Exemplo n.º 3
0
 class Bar(TestRedisModel):
     namespace = 'related-to-full'
     foo = FKStringField('related-to-full:Foo')
Exemplo n.º 4
0
 class A(M):
     database = db1
     b = FKStringField('B', related_name='a_set')
Exemplo n.º 5
0
 class B(M):
     database = db1
     a = FKStringField(A, related_name='b_set')
Exemplo n.º 6
0
class Group(TestRedisModel):
    name = fields.PKField()
    status = fields.StringField(indexable=True)
    owner = FKInstanceHashField(Person, related_name='owned_groups')
    parent = FKStringField('self', related_name='children')
    members = M2MSetField(Person, related_name='membership')
Exemplo n.º 7
0
 class Bar(TestRedisModel):
     namespace = 'related-to-model'
     foo = FKStringField(Foo)
Exemplo n.º 8
0
class Person(TestRedisModel):
    name = fields.PKField()
    age = fields.StringField(indexable=True)
    prefered_group = FKStringField('Group')
    following = M2MSetField('self', related_name='followers')
Exemplo n.º 9
0
 class PersonTest(TestRedisModel):
     namespace = 'related-name-inv'
     group = FKStringField('related-tests:Group',
                           related_name='list-of-persons')
Exemplo n.º 10
0
 class Base(TestRedisModel):
     abstract = True
     namespace = 'related-name-sub'
     name = fields.PKField()
     a_field = FKStringField(
         'Other', related_name='%(namespace)s_%(model)s_related')
Exemplo n.º 11
0
 class PersonTest(TestRedisModel):
     namespace = "related-name-ns"
     name = fields.PKField()
     first_group = FKStringField("related-tests:Group")
     second_group = FKStringField('Group')
Exemplo n.º 12
0
 class PersonTest(TestRedisModel):
     namespace = 'related-name'
     name = fields.PKField()
     most_hated_group = FKStringField(
         'related-tests:Group',
         related_name='%(namespace)s_%(model)s_set')