Custom boolean values #97

merged 2 commits into from May 6, 2013

3 participants

Pylons Project member

This is a pull request for issue #78. Going to add a few more fixes to it, in addition to @lmctv.

lmctv added some commits Jan 18, 2013
@lmctv lmctv Allow custom setting of true/false choices
both on deserialization and on serialization.

Preserve existing behaviour by setting false_choices to ('false', '0'),
true_choices to an empty tuple, false_val to 'false' and true_val to 'true'.

The new behaviour lets the caller use translated strings both in
deserialization and in serialization, as in:

    bool=Boolean(false_choices=(_('no'),_('false'),_('n'),_('f'), '0'),
                 true_choices=(_('yes'),_('true'),_('y'),_('t'), '1'),
                 false_val=_('false'), true_val=_('true'))
@lmctv lmctv Add myself to CONTRIBUTORS. 40caaa2
Pylons Project member

In hindsight, this commit appears to be complete. The only change I made was rebase it on the current master, so it can be pulled immediately. Changes were made to the api docs, and any further changes to the user documentation seem unnecessary. Ready to be pulled.

Pylons Project member

Oddly enough, this doesn't seem to be able to be merged directly, but I can merge it locally without problem.

@tseaver tseaver merged commit 40caaa2 into Pylons:master May 6, 2013
Pylons Project member

Thanks @lmctv and @jayd3e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment