Fix indentation, missing import

This commit is contained in:
David Glick
2013-07-10 15:09:24 -07:00
parent 7ab0f8aff3
commit 04544bbbd7

View File

@@ -33,6 +33,7 @@ serializes a boolean to the string ``true`` or ``false`` or the special
.. code-block:: python
:linenos:
from colander import Invalid
from colander import null
class Boolean(object):
@@ -40,12 +41,12 @@ serializes a boolean to the string ``true`` or ``false`` or the special
if appstruct is null:
return null
if not isinstance(appstruct, bool):
raise Invalid(node, '%r is not a boolean')
raise Invalid(node, '%r is not a boolean')
return appstruct and 'true' or 'false'
def deserialize(self, node, cstruct):
if cstruct is null:
return null
return null
if not isinstance(cstruct, basestring):
raise Invalid(node, '%r is not a string' % cstruct)
value = cstruct.lower()