validation.py 433 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. from apilib.monetary import RMB, Percent, Permillage
  3. from apps.web.core.validation import Schema, Coerce, ALLOW_EXTRA
  4. agentSchema = Schema(
  5. {
  6. 'username': basestring,
  7. 'password': basestring,
  8. 'nickname': basestring,
  9. 'annualTrafficCost': Coerce(RMB),
  10. 'managerProfitShare': Coerce(Percent),
  11. 'withdrawFeeRatio': Coerce(Permillage)
  12. }, extra=ALLOW_EXTRA)