예제 #1
0
class Star(Record):
    hip_id = Property(isa=int, required=True,
                      coerce=fix_id,
                      check=lambda i: 0 < i < 120000)
    name = Property(isa=str)
    spectral_type = Property(isa=str)
    designations = DictProperty(of=basestring)
    coordinates = DictProperty(of=list_of(basestring))
예제 #2
0
class Person(LegalPerson):
    age = Property(isa=int)
    kids = Property(isa=int, extraneous=True)
    interests = SafeProperty(isa=list)
    info = SafeProperty(isa=dict)
    primary_key = ['id']
    family = DictProperty(of=LegalPerson)
예제 #3
0
 class Pilcrow(Record):
     bar = ListProperty(of=Octothorpe)
     foo = Property(isa=Caret)
     baz = Property()
     quux = DictProperty(of=str)
     frop = DictProperty(of=list_of(unicode))
예제 #4
0
 class FussPot(Record):
     fuss_list = ListProperty(of=FussyRecord)
     fuss_map = DictProperty(of=FussyRecord)
     top_fuss = Property(isa=FussyRecord)
예제 #5
0
 class FakeSite(JsonRecord):
     slug = Property()
     _custom_tags = DictProperty(of=list_of(str))
예제 #6
0
 class Mapping(Record):
     items = DictProperty(of=str)
예제 #7
0
 class Drawer(Record):
     items = DictProperty(of=Item)
예제 #8
0
 class MyDoLoS(Record):
     items = DictProperty(of=list_of(str), default={})
예제 #9
0
 class HashMap(Record):
     intent = Property()
     hashed = DictProperty(of=Item)
예제 #10
0
class StarSystem(Record):
    name = Property(isa=str)
    components = Property(isa=StarList)
    attributes = DictProperty(of=StarAttribute)
예제 #11
0
class CheeseCupboardRecord(Record):
    id = ROProperty(required=True, isa=int)
    name = SafeProperty(isa=str)
    best_cheese = SafeProperty(isa=CheeseRecord)
    cheeses = ListProperty(of=CheeseRecord)
    favorites = DictProperty(of=CheeseRecord)