예제 #1
0
class ComplexL(lion.Mapper):
    foo = lion.StrField()
    bar = lion.Field(getter=lion.getters.call_method)
    sub = lion.MapperField(SubL)
    subs = lion.ListField(SubL)
예제 #2
0
 class MyMapper(lion.Mapper):
     _factory = Obj
     sth = lion.MapperField(SthMapper)
예제 #3
0
class ProjectMapper(lion.Mapper):
    _factory = Project
    id = lion.UUIDField()
    title = lion.StrField()
    logo = lion.MapperField(LogoMapper, condition=lion.skip_none)
예제 #4
0
class NodeMapper(lion.Mapper):
    _factory = Node
    id = lion.UUIDField()
    title = lion.StrField()
    parent = lion.MapperField('self', condition=lion.skip_none)
    children = lion.ListField('self', condition=lion.skip_empty)
예제 #5
0
class CompanyMapper(lion.Mapper):
    _factory = Company
    id = lion.UUIDField()
    title = lion.StrField()
    logo = lion.MapperField(LogoMapper, condition=lion.skip_none)