Closed erikkaplun closed 11 years ago
class MyModel(DBObject): field = None MyModel.validatesPresenceOf('field') assert MyModel().isValid() # succeeds
this is because presenceOf has:
presenceOf
if getattr(obj, name, "") == "":
but should have:
if getattr(obj, name, None) is None:
optionally you can add checking for "" depending on how you want to interpret empty strings:
""
if getattr(obj, name, None) in (None, ""):
Fixed in 1cd603a - thanks!
this is because
presenceOf
has:but should have:
optionally you can add checking for
""
depending on how you want to interpret empty strings: