'Get value for boolean property.
Explicitly checking for bool, or string with lower value
"true" or "false", to avoid integer values.'

def _get_bool(self, value):

    if (value is None):
        value = ((self.has_default() and self.default()) or False)
    if isinstance(value, bool):
        return value
    if isinstance(value, six.string_types):
        normalised = value.lower()
        if (normalised not in ['true', 'false']):
            raise ValueError((_('"%s"    is    not    a    valid    boolean') % normalised))
        return (normalised == 'true')
    raise TypeError((_('"%s"    is    not    a    valid    boolean') % value))
