[web2py] Re: Validating Registration fields

2012-03-28 Thread Peter G.
Thank you so much! That worked like a charm :). I'm guessing this type of construct is valid for other validators as well? On Tuesday, March 27, 2012 5:57:28 PM UTC-7, Anthony wrote: Try IS_EMPTY_OR(IS_IMAGE()) Anthony On Tuesday, March 27, 2012 7:12:45 PM UTC-4, Peter G. wrote:

[web2py] Re: Validating Registration fields

2012-03-28 Thread Anthony
On Wednesday, March 28, 2012 5:34:05 AM UTC-4, Peter G. wrote: Thank you so much! That worked like a charm :). I'm guessing this type of construct is valid for other validators as well? Yes, it's documented here: http://web2py.com/books/default/chapter/29/7#Validators

[web2py] Re: Validating Registration fields

2012-03-27 Thread Peter G.
Thanks for the code snippets Anthony--but a minor caveat I didn't realize ahead of time is that the user is free to either upload an image or not. If the user does not upload an image, the IS_IMAGE() validators barks at the user. Is there a easy way of implementing such a logic: if a file is

[web2py] Re: Validating Registration fields

2012-03-27 Thread Anthony
Try IS_EMPTY_OR(IS_IMAGE()) Anthony On Tuesday, March 27, 2012 7:12:45 PM UTC-4, Peter G. wrote: Thanks for the code snippets Anthony--but a minor caveat I didn't realize ahead of time is that the user is free to either upload an image or not. If the user does not upload an image, the

[web2py] Re: Validating Registration fields

2012-03-22 Thread Anthony
On Thursday, March 22, 2012 6:09:25 PM UTC-4, Peter G. wrote: I'm using the auth.settengs.extra_fields to add an extra upload field for the user to upload an avatar, how can I add an IS_IMAGE validator to the upload field so that the user can't upload random files? When you define the