使用bpmappers实现rebecca.todict
rebecca.todict_bpmappers的Python项目详细描述
rebecca.todict_bpmappers
rebecca.todict_bpmappers是rebecca.todict的实现 使用bpmappers
INSTALL
使用PIP或简易安装进行安装。
$ pip install rebecca.todict_bpmappers $ easy_install rebecca.todict_bpmappers
USAGE
rebecca.todict_bpmappers具有include挂钩。:
config.include('rebecca.todict_bpmappers')
这个钩子也将包含rebecca.todict。
bpmapperdecorator register todict适配器由bpmappers实现。
from bpmappers import Mapper, RawField from rebecca.todict_bpmappers import bpmapper @bpmapper('dummy.Person', name="p1") class PersonMapper(Mapper): username = RawField('name') num = RawField('value')
要使用该映射器,请调用todictapi ofrebecca.todict:
d = todict(request, person, name="p1")
Contributors
- Atsushi Odagiri,原作者