Beispiel #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))
Beispiel #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)
 class Pilcrow(Record):
     bar = ListProperty(of=Octothorpe)
     foo = Property(isa=Caret)
     baz = Property()
     quux = DictProperty(of=str)
     frop = DictProperty(of=list_of(unicode))
 class FussPot(Record):
     fuss_list = ListProperty(of=FussyRecord)
     fuss_map = DictProperty(of=FussyRecord)
     top_fuss = Property(isa=FussyRecord)
Beispiel #5
0
 class FakeSite(JsonRecord):
     slug = Property()
     _custom_tags = DictProperty(of=list_of(str))
Beispiel #6
0
 class Mapping(Record):
     items = DictProperty(of=str)
Beispiel #7
0
 class Drawer(Record):
     items = DictProperty(of=Item)
Beispiel #8
0
 class MyDoLoS(Record):
     items = DictProperty(of=list_of(str), default={})
Beispiel #9
0
 class HashMap(Record):
     intent = Property()
     hashed = DictProperty(of=Item)
Beispiel #10
0
class StarSystem(Record):
    name = Property(isa=str)
    components = Property(isa=StarList)
    attributes = DictProperty(of=StarAttribute)
Beispiel #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)