class ComplexL(lion.Mapper): foo = lion.StrField() bar = lion.Field(getter=lion.getters.call_method) sub = lion.MapperField(SubL) subs = lion.ListField(SubL)
class MyMapper(lion.Mapper): _factory = Obj sth = lion.MapperField(SthMapper)
class ProjectMapper(lion.Mapper): _factory = Project id = lion.UUIDField() title = lion.StrField() logo = lion.MapperField(LogoMapper, condition=lion.skip_none)
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)
class CompanyMapper(lion.Mapper): _factory = Company id = lion.UUIDField() title = lion.StrField() logo = lion.MapperField(LogoMapper, condition=lion.skip_none)