예제 #1
0
 class M:
     s = string_field(factory=lambda: 'hello')
     d = datetime_field(factory=lambda: dt)
     i = int_field(factory=lambda: 2)
     dec = decimal_field(factory=lambda: decimal.Decimal('3'))
     f = float_field(factory=lambda: 2.3)
     b = bool_field(factory=lambda: True)
     by = bytes_field(factory=lambda: b'x')
     u = url_field(factory=lambda: 'https://foo.com')
     a = any_field(factory=lambda: 1)
     o = object_field(int, factory=lambda: 2)
     k = key(int, factory=lambda: 3)
예제 #2
0
 class B:
     a = object_field(A)
예제 #3
0
 class Container:
     expr = object_field(UnionKind(('and', And), ('not', Not)))
예제 #4
0
 class Not:
     item = object_field(Value, is_only_field=True)
예제 #5
0
 class M:
     m = object_field(
         UnionKind(
             ('target', DeferredKind('tests.test_models.TargetModel')), ))
예제 #6
0
 class M:
     a = object_field(L)
예제 #7
0
 class Not:
     item = object_field(Value)
예제 #8
0
 class M:
     dt = datetime_field()
     sub = object_field(SELF, is_optional=True, default=None)
예제 #9
0
 class C:
     b = object_field(B)
예제 #10
0
 class M:
     f = object_field(X, is_optional=True, default=None)
예제 #11
0
 class M:
     f = object_field(SELF, is_optional=True)
예제 #12
0
 class M:
     f = object_field(X)