|
From: Ian B. <ia...@co...> - 2005-09-08 20:23:55
|
Ksenia Marasanova wrote: > 2005/9/8, Ian Bicking <ia...@co...>: > >>Ksenia Marasanova wrote: >> >>>Hi, >>> >>>When "max" parameter is specified for String validator that is allowed >>>to be empty, error occures when None value is passed: >>> >>>........ line 842, in validate_python >>> if self.max is not None and len(value) > self.max: >>>TypeError: len() of unsized object >>> >>>Is it a bug or am I doing something wrong? >> >>Sounds like a bug, should be fixed in r975. Should also work with min >>now as well. > > > Thanks for the quick response. > But it looks like "min" now implies "not_empty". Is it intentional? Well, that's kind of an outstanding issue; right now not_empty is implied in many places. But not everywhere. This just exposes that, I guess; it wasn't really changed. To me min>0 does kind of imply not_empty, though I suppose it could be argument that None should still get through if not_empty had to be given explicitly. Except None and '' are generally treated very similarly, and min>0 *definitely* implies that '' isn't valid. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |