You can subscribe to this list here.
| 2004 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(6) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
(8) |
Nov
(9) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(13) |
May
(34) |
Jun
(7) |
Jul
(6) |
Aug
(1) |
Sep
(23) |
Oct
(37) |
Nov
(41) |
Dec
(39) |
| 2006 |
Jan
(19) |
Feb
(1) |
Mar
(5) |
Apr
(9) |
May
(3) |
Jun
(8) |
Jul
(6) |
Aug
(12) |
Sep
(15) |
Oct
(26) |
Nov
(7) |
Dec
(11) |
| 2007 |
Jan
(12) |
Feb
(6) |
Mar
(13) |
Apr
(14) |
May
(12) |
Jun
(8) |
Jul
(3) |
Aug
|
Sep
(4) |
Oct
(19) |
Nov
(9) |
Dec
|
| 2008 |
Jan
(14) |
Feb
(3) |
Mar
(11) |
Apr
(6) |
May
(18) |
Jun
(15) |
Jul
(1) |
Aug
(23) |
Sep
(18) |
Oct
(39) |
Nov
(11) |
Dec
(16) |
| 2009 |
Jan
(8) |
Feb
(9) |
Mar
(33) |
Apr
(16) |
May
(5) |
Jun
(3) |
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(6) |
Nov
(11) |
Dec
(2) |
| 2010 |
Jan
(2) |
Feb
(4) |
Mar
|
Apr
|
May
(2) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
(36) |
Sep
(8) |
Oct
(1) |
Nov
|
Dec
(10) |
| 2012 |
Jan
(3) |
Feb
(5) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
(1) |
| 2013 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(10) |
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
(4) |
| 2015 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(1) |
Nov
(2) |
Dec
|
| 2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Robert F. <fo...@zi...> - 2005-10-05 11:47:20
|
you might want to look at this introduction:
http://www.groovie.org/files/SQLObjectFormEncodePresentation.pdf
Gregor Horvath wrote:
> Hi,
>
> I am just evaluationg FormEncode and read the docs and played a little
> bit with it.
>
> There is one question left:
>
> How do you do domain specific validation, where fields are dependend
> from each other?
>
> Example
>
> Form:
> Field A
> Field B
> Field C
>
> If Field A is filled then B and not C has to be filled.
> If B is filled then A has to be value = "X"
>
> Design.txt says FormEncode knows nothing about the domain.
> Do I have to write an extra layer of form validation for that?
>
> Or is it possible to integrate that kind of checks in FormEncode, for
> example by writing an own validator?
>
> --
> Greg
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> FormEncode-discuss mailing list
> For...@li...
> https://lists.sourceforge.net/lists/listinfo/formencode-discuss
>
> .
>
--
the idea is to keep the green alien landing craft from taking up humans
from the ground and changing them into mutants. a mutant is very
dangerous to you, because it flies faster than you do and shoots at you.
|
|
From: Gregor H. <g.h...@gm...> - 2005-10-05 10:57:39
|
Hi, I am just evaluationg FormEncode and read the docs and played a little bit with it. There is one question left: How do you do domain specific validation, where fields are dependend from each other? Example Form: Field A Field B Field C If Field A is filled then B and not C has to be filled. If B is filled then A has to be value = "X" Design.txt says FormEncode knows nothing about the domain. Do I have to write an extra layer of form validation for that? Or is it possible to integrate that kind of checks in FormEncode, for example by writing an own validator? -- Greg |
|
From: Ksenia M. <kse...@gm...> - 2005-10-02 20:23:38
|
Hi, I think it's a bug. Patch attached. -- Ksenia |
|
From: Kevin D. <da...@gm...> - 2005-09-27 19:31:43
|
On 9/27/05, Ian Bicking <ia...@co...> wrote: > Kevin Dangoor wrote: > > Those sound like good suggestions to me. I'll head down that path in > > my copious free time :) > > Well, it's easy enough for me to make those changes anyway, so I > committed it, r1044. Hey, thanks! Kevin -- Kevin Dangoor Author of the Zesty News RSS newsreader email: ki...@bl... company: http://www.BlazingThings.com blog: http://www.BlueSkyOnMars.com |
|
From: Ian B. <ia...@co...> - 2005-09-27 19:27:25
|
Kevin Dangoor wrote: > Those sound like good suggestions to me. I'll head down that path in > my copious free time :) Well, it's easy enough for me to make those changes anyway, so I committed it, r1044. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
|
From: Kevin D. <da...@gm...> - 2005-09-27 19:18:00
|
On 9/27/05, Ian Bicking <ia...@co...> wrote: > Kevin Dangoor wrote: > > The simple StringBoolean validator that I created (which takes string > > values like "true" and "False" and turns them into proper booleans) > > seems generally useful, and also seems ripe for merging directly with > > the FormEncode boolean validator. > > > > http://www.turbogears.org/svn/turbogears/trunk/turbogears/validators.py > > > > What do other people think? > > Sure, though with a few changes: > > if_empty =3D False instead of testing the value and returning False (this > way the default is overridable) > > The true strings and false strings should also be attributes. And I'd > be inclined to make them ['true', 't', 'yes', 'y', 'on'] and ['false', > 'f', 'no', 'n', 'off']. And probably just assume the first item in the > list is the preferred string, and ignore (but accept) the others for > messages. > > Last, you should strip the value. > > Oh, and _from_python should return 'true' or 'false'. > > Umm, yeah, just a few changes ;) Those sound like good suggestions to me. I'll head down that path in my copious free time :) Kevin -- Kevin Dangoor Author of the Zesty News RSS newsreader email: ki...@bl... company: http://www.BlazingThings.com blog: http://www.BlueSkyOnMars.com |
|
From: Ian B. <ia...@co...> - 2005-09-27 19:14:21
|
Kevin Dangoor wrote: > The simple StringBoolean validator that I created (which takes string > values like "true" and "False" and turns them into proper booleans) > seems generally useful, and also seems ripe for merging directly with > the FormEncode boolean validator. > > http://www.turbogears.org/svn/turbogears/trunk/turbogears/validators.py > > What do other people think? Sure, though with a few changes: if_empty = False instead of testing the value and returning False (this way the default is overridable) The true strings and false strings should also be attributes. And I'd be inclined to make them ['true', 't', 'yes', 'y', 'on'] and ['false', 'f', 'no', 'n', 'off']. And probably just assume the first item in the list is the preferred string, and ignore (but accept) the others for messages. Last, you should strip the value. Oh, and _from_python should return 'true' or 'false'. Umm, yeah, just a few changes ;) -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
|
From: Kevin D. <da...@gm...> - 2005-09-27 18:41:43
|
The simple StringBoolean validator that I created (which takes string values like "true" and "False" and turns them into proper booleans) seems generally useful, and also seems ripe for merging directly with the FormEncode boolean validator. http://www.turbogears.org/svn/turbogears/trunk/turbogears/validators.py What do other people think? Kevin -- Kevin Dangoor Author of the Zesty News RSS newsreader email: ki...@bl... company: http://www.BlazingThings.com blog: http://www.BlueSkyOnMars.com |
|
From: Ian B. <ia...@co...> - 2005-09-25 06:25:22
|
Ksenia Marasanova wrote:
> Hi,
>
> I have this dictionary that I pass to variabledecode, but before that
> it gets updated somewhere with default variables. Sometimes they
> happen to be integers. But variabledecode doesn't expect integers.
>
> If this is not a misuse of variabledecode, here is a little patch:
>
> ===================================================================
> --- variabledecode.py (revision 1029)
> +++ variabledecode.py (working copy)
> @@ -53,7 +53,7 @@
> place = result
> for i in range(len(new_keys)-1):
> try:
> - if isinstance(place[new_keys[i]], (str, unicode, list)):
> + if isinstance(place[new_keys[i]], (int, str, unicode, list)):
> place[new_keys[i]] = {None: place[new_keys[i]]}
> place = place[new_keys[i]]
> except KeyError:
I guess that's harmless. I wonder, though, if that shouldn't simple be
"not isinstance(place[new_keys[i]], dict)"...
Hmm... okay, I've modified it in that way instead.
|
|
From: Ksenia M. <kse...@gm...> - 2005-09-25 02:41:27
|
Hi,
I have this dictionary that I pass to variabledecode, but before that
it gets updated somewhere with default variables. Sometimes they
happen to be integers. But variabledecode doesn't expect integers.
If this is not a misuse of variabledecode, here is a little patch:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- variabledecode.py (revision 1029)
+++ variabledecode.py (working copy)
@@ -53,7 +53,7 @@
place =3D result
for i in range(len(new_keys)-1):
try:
- if isinstance(place[new_keys[i]], (str, unicode, list)):
+ if isinstance(place[new_keys[i]], (int, str, unicode, list=
)):
place[new_keys[i]] =3D {None: place[new_keys[i]]}
place =3D place[new_keys[i]]
except KeyError:
--
Ksenia
|
|
From: N. C. D. R. <nc...@gm...> - 2005-09-23 15:22:09
|
Hi List, # Formencode Newbie Alert # First of all I would like to thank all the contributors to this fantastic package. The following is a small patch (against the latest revision) that fixed a problem I had with the module. I found that the module choked on multiple selects and did not quite work as expected. I have spent very little time on the patch but it works for my purposes. Thought it would be useful to others and thus this mail. Usage: The only necessity is that the select tag has to be coded in the following manner (only in the case of multiple selects - other selects do not have to be changed): <select name="items" multiple="multiple">. Please correct me if I have gone off in a tangent with my usage of the module. I would also appreciate some close scrutiny on the diff by the guys who know the internals well for any bugs. Thanks, N. C. Deepak Ramesh |
|
From: Jeffrey E. F. <jfo...@st...> - 2005-09-20 20:00:50
|
On Sep 20, 2005, at 3:42 PM, Ian Bicking wrote: > You should use an object. A bunch-like object is probably a good > idea. > > State is left as None usually, and nothing is kept in it. However, > when it is not None, the schema tries to assign some special > attributes to it (like full_dict). If you use an object that > allows attribute assignment (which dictionaries don't) then it > should work. I could've sworn I did try with a typical 'class MyClass(object): pass' type of object, but apparently I didn't, because that does do the trick! Thanks, and my apologies :) Regards, Jeff -- Jeffrey E. Forcier Junior Developer, Research and Development Stroz Friedberg, LLC 15 Maiden Lane, 12th Floor New York, NY 10038 [main]212-981-6540 [direct]212-981-6546 http://www.strozllc.com This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No right to confidential or privileged treatment of this message is waived or lost by any error in transmission. If you have received this message in error, please immediately notify the sender by e-mail or by telephone at 212.981.6540, delete the message and all copies from your system and destroy any hard copies. You must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message if you are not the intended recipient. |
|
From: Ian B. <ia...@co...> - 2005-09-20 19:43:39
|
Jeffrey E. Forcier wrote:
> theForm = someWebFramework.request.form
> theCurrentObject = SQLObject.get(id)
> validationSchema = MySchema()
> valiatedForm = validationSchema.to_python(theForm)
>
> Assuming that works okay, the only way I can think of passing in the
> object to 'state' would be to replace the last line above with this:
>
> validatedForm = validationSchema.to_python(theForm,
> {'myInstance':theCurrentObject})
>
> If 'state' is supposed to be an object and not a dictionary, pretend I
> used an object + attribute assignment instead.
You should use an object. A bunch-like object is probably a good idea.
>
> Anyway, the problem of course is that if I try something along those
> lines, the schema complains about the state object not having
> 'full_dict', which is understandable if 'state' is filled in magically.
State is left as None usually, and nothing is kept in it. However, when
it is not None, the schema tries to assign some special attributes to it
(like full_dict). If you use an object that allows attribute assignment
(which dictionaries don't) then it should work.
--
Ian Bicking / ia...@co... / http://blog.ianbicking.org
|
|
From: Jeffrey E. F. <jfo...@st...> - 2005-09-20 19:02:15
|
Starting to implement FormEncode in a project (which also uses
SQLObject; you rock, Ian!) and I can't figure out the proper usage of
the 'state' object. Say I need to refer to a SQLObject instance that
my app is trying to apply updates to, which are received from a web
form; I need to pass that instance in to the validator(s) so they can
refer to its current database values.
Something like this:
class MyValidator(formencode.FancyValidator):
def validate_python(self,value,state):
if state['myInstance'].someAttribute = value:
raise Invalid(etc,etc,etc)
class MySchema(formencode.Schema):
aValidator = MyValidator()
...
I assume I'd want to use the schema thusly (and maybe even this is
wrong, I don't know):
theForm = someWebFramework.request.form
theCurrentObject = SQLObject.get(id)
validationSchema = MySchema()
valiatedForm = validationSchema.to_python(theForm)
Assuming that works okay, the only way I can think of passing in the
object to 'state' would be to replace the last line above with this:
validatedForm = validationSchema.to_python(theForm,
{'myInstance':theCurrentObject})
If 'state' is supposed to be an object and not a dictionary, pretend
I used an object + attribute assignment instead.
Anyway, the problem of course is that if I try something along those
lines, the schema complains about the state object not having
'full_dict', which is understandable if 'state' is filled in magically.
So...how is this supposed to work? I assume it's something simple and
I'm just not getting it.
Thanks,
Jeff
--
Jeffrey E. Forcier
Junior Developer, Research and Development
Stroz Friedberg, LLC
15 Maiden Lane, 12th Floor
New York, NY 10038
[main]212-981-6540 [direct]212-981-6546
http://www.strozllc.com
This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No right to
confidential or privileged treatment of this message is waived or lost
by any error in transmission. If you have received this message in
error, please immediately notify the sender by e-mail or by telephone at
212.981.6540, delete the message and all copies from your system and
destroy any hard copies. You must not, directly or indirectly, use,
disclose, distribute, print or copy any part of this message if you are
not the intended recipient.
|
|
From: Robert F. <fo...@zi...> - 2005-09-14 07:15:33
|
Ian Bicking wrote: > Incidentally, I put a small example in the repository yesterday: > > http://svn.colorstudy.com/FormEncode/trunk/examples/ > > If anyone else has running examples they'd like to include, that would > be great. hi all, the following snippet provides a validator class to use with sqlobject. i use it for web forms which store object ids in fields. the db connection is passed in with the state. dunno if that's the kind of examples you were refererring to. regards, robert class ObjectValidator(formencode.validators.Number): """ virtual base class for db object validators pass a table class as 'object_class'. validates an db object ID, converts it to the corresponding object. """ object_class = None def _to_python(self, value, state): value = formencode.validators.Number._to_python(self, value, state) if self.object_class is not None: try: value = self.object_class.get(value, connection=state.page.connection.c) except SQLObjectNotFound: raise formencode.Invalid('invalid object ID', value, state) return value > If they could be made runnable with paste.deploy, that would be even > greater ;) (Though heck, if I haven't released paste.deploy and > company yet, I suppose it's not that great... but once that stack is > properly released it should provide a good way to start up diverse > examples.) > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing > & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > FormEncode-discuss mailing list > For...@li... > https://lists.sourceforge.net/lists/listinfo/formencode-discuss > > . > -- the idea is to keep the green alien landing craft from taking up humans from the ground and changing them into mutants. a mutant is very dangerous to you, because it flies faster than you do and shoots at you. |
|
From: Ian B. <ia...@co...> - 2005-09-13 21:42:53
|
Ben Bangert wrote: > Is this a common of enough case that something like this might be > included with FormEncode in the future? Yes, I think it probably could be. It (or something similar) can work well with "other" text fields as well, like a select box where the "other" field has to be filled in if they select "Other..." in the dropdown (and shouldn't be filled in if not). -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
|
From: Ben B. <be...@gr...> - 2005-09-13 21:25:26
|
On Sep 13, 2005, at 2:12 PM, Ian Bicking wrote:
> Billing() is being asked to validate shippingdifferent, the empty
> checkbox.
>
> I think you want a chained validator, maybe like (untested):
>
> class IfChecked(FormValidator):
> field_name = None
> next_schema = None
> __unpackargs__ = ('field_name', 'next_schema')
> def _to_python(self, form, state):
> assert self.field_name and self.next_schema
> if not form.get(self.field_name):
> return form
> else:
> return self.next_schema.to_python(form, state)
>
> class Shipping(Schema):
> chained_validators = [IfChecked('shippingdifferent', Billing())]
Excellent, I just tried it, and it does work. :)
Is this a common of enough case that something like this might be
included with FormEncode in the future?
Thanks,
Ben
|
|
From: Ian B. <ia...@co...> - 2005-09-13 21:13:04
|
Ben Bangert wrote:
> I have what I think is fairly common for validation. A single large
> form, but the second half of it should only be validated conditionally.
> That is, if they check the checkbox for "My shipping info is
> different", then it will validate the second portion of the form. I was
> trying to do it like this:
> class Billing(Schema):
> ...billing fields...
>
> class Shipping(Schema):
> ...shipping fields...
> shippingdifferent = formencode.Any(validators.Empty(), Billing())
>
> My belief was that if I use Any, and they didn't click the checkbox,
> it'd validate the remainder. This doesn't seem to be happening, what
> step am I missing?
Billing() is being asked to validate shippingdifferent, the empty checkbox.
I think you want a chained validator, maybe like (untested):
class IfChecked(FormValidator):
field_name = None
next_schema = None
__unpackargs__ = ('field_name', 'next_schema')
def _to_python(self, form, state):
assert self.field_name and self.next_schema
if not form.get(self.field_name):
return form
else:
return self.next_schema.to_python(form, state)
class Shipping(Schema):
chained_validators = [IfChecked('shippingdifferent', Billing())]
--
Ian Bicking / ia...@co... / http://blog.ianbicking.org
|
|
From: Ben B. <be...@gr...> - 2005-09-13 21:05:20
|
I have what I think is fairly common for validation. A single large
form, but the second half of it should only be validated
conditionally. That is, if they check the checkbox for "My shipping
info is different", then it will validate the second portion of the
form. I was trying to do it like this:
class Billing(Schema):
...billing fields...
class Shipping(Schema):
...shipping fields...
shippingdifferent = formencode.Any(validators.Empty(), Billing())
My belief was that if I use Any, and they didn't click the checkbox,
it'd validate the remainder. This doesn't seem to be happening, what
step am I missing?
Thanks,
Ben
|
|
From: Ian B. <ia...@im...> - 2005-09-13 16:09:26
|
Incidentally, I put a small example in the repository yesterday: http://svn.colorstudy.com/FormEncode/trunk/examples/ If anyone else has running examples they'd like to include, that would be great. If they could be made runnable with paste.deploy, that would be even greater ;) (Though heck, if I haven't released paste.deploy and company yet, I suppose it's not that great... but once that stack is properly released it should provide a good way to start up diverse examples.) |
|
From: Ksenia M. <kse...@gm...> - 2005-09-08 21:07:23
|
2005/9/8, Ian Bicking <ia...@co...>: > 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? >=20 > 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. >=20 > 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. I think I am in the camp of "None is not '' " :). Maybe it can be made an option, something like "keep_blank_values" in cgi.FieldStorage... --=20 Ksenia |
|
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 |
|
From: Ksenia M. <kse...@gm...> - 2005-09-08 20:15:07
|
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?
>=20
> 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?
>>> validators.String(max=3D2).to_python(None)
>>> validators.String(min=3D2).to_python(None)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/Users/ksenia/www/3rdparty/formencode/api.py", line 223, in to_pyth=
on
self.validate_python)
File "/Users/ksenia/www/3rdparty/formencode/api.py", line 211, in
attempt_convert
post(converted, state)
File "validators.py", line 851, in validate_python
value, state)
api.Invalid: Enter a value 2 characters long or more
>>>=20
--=20
Ksenia
|
|
From: Ian B. <ia...@co...> - 2005-09-08 19:32:28
|
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. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
|
From: Ksenia M. <kse...@gm...> - 2005-09-08 18:50:28
|
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?
Thanks,
Ksenia.
|