I ended up monkey patching the xmlvalue
function.
class MyBoolean(Boolean):
@check_no_collection
def xmlvalue(self, value):
return "1" if value and value not in ("false", "0") else "0"
Boolean.xmlvalue = MyBoolean.xmlvalue
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…