p0tat03 schrieb:
> Hey all,
> 
> I'm trying to implement a DateTimePicker widget in a form, but I'm
> receiving a strange error:
> 
> Field:
> ====
> 
> call_start = widgets.CalendarDatePicker(name='call_start', \
>         label="Call Start", validator= \
>         validators.DateTimeConverter(format="%m/%d/%Y"))
> 
> The form submits alright, but when I try to store the result into a
> DateCol, I get the following:
> 
> Invalid: expected an date/time string of the '%Y-%m-%d' format in the
> DateTimeCol 'call_start', got <type 'str'> '2007-04-09 00:00:00'
> instead
> 
> Is the string not correct? It is in the Y-m-d format. Is the time
> string at the back interfering with things? If so, is there a way to
> strip that? Should I be using a DateTimeCol instead? (I have no use
> for the time, I am only interested in the date, but it won't hurt any
> to store it)

It could be a bug. Try adding an additional Schema that contains a 
call_start-element with a DateTimeConverter.

If adding that as validators in your validate-decorator (together with 
the form like this

@validate(form=the_form, validator=the_schema)

)

it might work. I at least have that problem with TG 1.0.1, I always 
wanted to create a patch or at least file a bug...

Diez

--~--~---------~--~----~------------~-------~--~----~
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