class BookMapper(Mapper): title = RawField() price = RawField() hoge = NonKeyField() def filter_hoge(self): return self.options['hoge']
class TeacherMapper(ModelMapper): goodCount = RawField('good_count') badCount = RawField('bad_count') class Meta: model = Teacher exclude = ('good_count', 'bad_count', 'subject')
class BookMapper(Mapper): title = RawField() price = RawField() author = DelegateField(AuthorMapper) # priceをfloat型に変換 def filter_price(self, value): return float(value)
class TaskMapper(Mapper): uid = RawField('_uid') script = RawField('_script') script_args = RawField('_script_args') ignore_result = RawField('_ignore_result') task_args = RawField('_task_args') result = RawField('_result') status = RawField('_status')
class BookMapper(Mapper): title = RawField() price = RawField() author = DelegateField(AuthorMapper)
class AuthorMapper(Mapper): name = RawField() company = RawField()
class PlayerMapper(Mapper): Name = RawField('name') Generation = RawField('generation') Level = RawField('level')
class AuthorMapper(Mapper): name = RawField() company = RawField() cp_code = RawField('company_code')
class BookMapper(Mapper): title = RawField() price = RawField() author = RawField()
class ItemMapper(ResouceMapper): item_id = RawField('id') item_name = RawField('name')
class ResouceMapper(Mapper): resource_uri = RawField()
class BookMapper(Mapper): title = RawField() price = RawField() author = DelegateField(AuthorMapper) cp_code = RawField('author.company_code')
class SubjectMapper(ModelMapper): isHot = RawField('is_hot') class Meta: model = Subject exclude = ('is_hot', )
class BookMapper(Mapper): title = RawField() price = RawField() author = DelegateField(AuthorMapper, attach_parent=True)
class ItemMapper(Mapper): item_id = RawField('id') item_name = RawField('name') item_price = RawField('price')
class CommentMapper(Mapper): author = RawField() text = RawField()