Re: worse date converter

"Matthew Wilson" <[email protected]> Sat, 6 Sep 2008 22:23:56 -0400
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
Christopher, thanks for the reply.

On Sat, Sep 6, 2008 at 10:09 PM, Christopher Singley <[email protected]> wrote:
> Matthew,
>
> In ascending order of significance:
>
> First, starting with 2.5, you don't need to import the time module.  You can
> just write "return datetime.datetime.strptime(value, datefmt).date()".

Good to know!  Thanks for the tip.

> Second, it looks like your from_python() is broken as written.

Yeah, that's because I wrote from_python before I made it possible to
pass in a list of formats rather than just one.

Thanks for the code samples in your third and fourth points.

Matt


-- 
Matthew Wilson
[email protected]
http://tplus1.com
216-470-6058

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/