Hey,

Thanks for the quick response. You can see my comments in-line.

On Tuesday, November 27, 2012 3:12:39 PM UTC+2, Aymeric Augustin wrote:

> 2012/11/27 Ion Scerbatiuc <[email protected] <javascript:>>
>
>> The datetimes in the POST are created using timezone.now() (and I have 
>> USE_TZ = True)
>>
>
> The POST data simulates the values entered by the user in the form. It 
> should contain naive datetimes in local time.
>
 
I'm sorry I was a little bit unclear. The datetimes are created using 
timezone.now() but the request factory receives a string representing the 
datetime using .isoformat(' '). 


> Actually, to be realistic, it should contain strings representing naive 
> date times, because that's what will be POST-ed by a HTML form. But using a 
> datetime object works too.
>

I'm not 100% sure that the datetimes received in the POST should represent 
naive date times. I mean there might be use cases when they represent aware 
datetimes:

   - there is a custom widget that allows the user to specify the timezone
   - the data is coming through a REST API and you have a form handling the 
   validation
   - ...


> I'm wondering if someone encountered this issue before, or if there is 
>> already a ticket submitted. I personally failed to find one, but maybe I 
>> just suck at searching Trac.
>>
>
> As far as I know, you're the first one to report this problem.
>
> We have two options:
>   - improve the code so an aware datetime is accepted as form input, and 
> passed-through unchanged;
>   - document this as a known pitfall.
>
> Could you file a ticket in Trac? I'll take a look as soon as possible.
>

I will definitely create a ticket in Trac and provide more information on 
my use case. I'll post the ticket number on this thread for visibility when 
I'm done.
 

>
> -- 
> Aymeric.
>

Ion
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/SirXwMHybxMJ.
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/django-developers?hl=en.

Reply via email to