Ken,

That is totally sweet!  Is this something TG specific because I do not
remember seeing such a validator in the formencode source/docs?

If this validator will use ISO format, then I can leave the paginate.py
code alone.  Paginate stuffs all of the form variables into query
strings using tg's url() method.  This means for attributes like dates,
whatever __str__() returns is what is put in the query string.  For
datetime, this is ISO format, so if the validator does not work with
that format, no love!

Thanks for the tip.  I will try this out and let you know!

Ken Kuhlman wrote:
> I was looking at validators today & remembered your problem.  While
> formencode's DateConverter doesn't support arbitrary date formats,
> there's a DateTimeConverter bundled with TG that does:
>
>   
>>>> from turbogears.validators import DateTimeConverter
>>>> d = DateTimeConverter(format='%Y-%m-%d')
>>>> d.to_python('2007-01-09')
>>>>         
> datetime.datetime(2007, 1, 9, 0, 0)
>   
>
>
> >
>   

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to