Re: Check-in #7 / Multiple timezone support for datetime representation

2011-10-30 Thread Aymeric Augustin
Hi Preston, On 30 oct. 2011, at 17:07, ptone wrote: > I do think a better label than "value" could be used for the > thread.local for the current timezone, as this is really a thread > global - something less ambiguous and conflict prone would be better > IMO. I used this name for consistency wit

Re: Check-in #7 / Multiple timezone support for datetime representation

2011-10-30 Thread ptone
I just did an initial scan through: https://bitbucket.org/aaugustin/django/compare/..django/django and this looks like a great piece of work. I do think a better label than "value" could be used for the thread.local for the current timezone, as this is really a thread global - something less amb

Re: Check-in #7 / Multiple timezone support for datetime representation

2011-10-30 Thread Aymeric Augustin
True. I think >>>>> "supports_timezones" should be False. Does anyone know why it's True? Is >>>>> it just an historical artifact? >>>>> >>>>> >>>>> Finally, I have read the document that describes "to_python", >&

Re: Check-in #5 / Multiple timezone support for datetime representation

2011-10-23 Thread Anssi Kääriäinen
On Oct 23, 7:16 pm, Aymeric Augustin wrote: > > Converters can be > > registered per-column - the SELECT query would need to be tweaked to > > hint to the SQLite libs to call the registered converter. I'm not sure > > if that would be too intrusive to the existing Django query builder. > > I didn'

Re: Check-in #5 / Multiple timezone support for datetime representation

2011-10-23 Thread Aymeric Augustin
On 18 oct. 2011, at 14:48, Daniel Swarbrick wrote: > On Oct 16, 11:48 am, Aymeric Augustin > wrote: >> Hello, >> >> I've implemented the storage and retrieval of aware datetime objects in >> SQLite. This involved some refactoring, because SQLite returns datetimes as >> strings, and I didn't wa

Check-in #6 / Multiple timezone support for datetime representation

2011-10-23 Thread Aymeric Augustin
; >>>> -- >>>> Aymeric Augustin. >>>> >>>> >>>> >>>> On 11 sept. 2011, at 23:18, Aymeric Augustin wrote: >>>> >>>>> Hello, >>>>> >>>>> Given the positive feedback received here and on IRC

Re: Check-in #5 / Multiple timezone support for datetime representation

2011-10-18 Thread Daniel Swarbrick
On Oct 16, 11:48 am, Aymeric Augustin wrote: > Hello, > > I've implemented the storage and retrieval of aware datetime objects in > SQLite. This involved some refactoring, because SQLite returns datetimes as > strings, and I didn't want to duplicate the parsing code. All database > backends ar

Check-in #5 / Multiple timezone support for datetime representation

2011-10-16 Thread Aymeric Augustin
s my branch to trunk: >>>> https://bitbucket.org/aaugustin/django/compare/..django/django >>>> >>>> I've read a lot of code in django.db, and also the documentation of >>>> PostgreSQL, MySQL and SQLite regarding date/time types. >>>> >&

Check-in #4 / Multiple timezone support for datetime representation

2011-10-02 Thread Aymeric Augustin
gt; goal is to guarantee backwards-compatibility when USE_TZ = False. >>> >>> At first they failed because runtests.py doesn't set os.environ['TZ'] and >>> doesn't call time.tzset() , so the tests ran with my system local time. I >>> f

Check-in #3 / Multiple timezone support for datetime representation

2011-09-24 Thread Aymeric Augustin
, since everything is supposed to be in UTC internally when USE_TZ >> is True, it is theoretically to get rid of os.environ['TZ'] and >> time.tzset(). They are only useful to make timezone-dependant functions >> respect the TIME_ZONE setting. However, for back

Check-in #2 / Multiple timezone support for datetime representation

2011-09-17 Thread Aymeric Augustin
s better to keep them and interpret naive datetimes in > the timezone defined by settings.TIME_ZONE (instead of rejecting them > outright). For this reason, I've decided to keep os.environ['TZ'] and > time.tzset() even when USE_TZ is True. > > Best regards, >

Check-in #1 / Multiple timezone support for datetime representation

2011-09-11 Thread Aymeric Augustin
40, Aymeric Augustin wrote: > Hello, > > The GSoC proposal "Multiple timezone support for datetime representation" > wasn't picked up in 2011 and 2010. Although I'm not a student and the summer > is over, I'd like to tackle this problem, and I would appreciate it

Re: Multiple timezone support for datetime representation

2011-09-08 Thread Daniel Swarbrick
On Sep 8, 5:55 am, Kirit Sælensminde (kayess) wrote: > There is also a Django time field. How to handle this is kind of hard > as having a timezone on a time field may not make much sense. At the > moment it is up to application code to combine this with a date in a > sane manner. If Django switc

Re: Multiple timezone support for datetime representation

2011-09-07 Thread kayess
I just wanted to chime in with a couple of extra notes here. I won't comment on most of it as I think it's all spot on :) On Sep 3, 10:40 pm, Aymeric Augustin wrote: > Django should use timezone-aware UTC datetimes internally > . > > Example

Re: Multiple timezone support for datetime representation

2011-09-07 Thread Daniel Swarbrick
On Sep 6, 10:47 pm, Aymeric Augustin wrote: > Under PostgreSQL, I assume I have to use a TIMESTAMP WITH TIME ZONE and set > the connection's timezone to UTC if I want non-Django applications using the > same database to obtain correct results, regardless of their connection's > timezone. To be

Re: Multiple timezone support for datetime representation

2011-09-07 Thread Aymeric Augustin
2011/9/6 Paul McMillan : >> I'm going to use the same trick used by USE_L10N and explained by Anssi: set >> USE_TZ to False in global_settings.py and to True in the template of >> settings.py. This preserves backwards compatibility but the new code is the >> default for new projects. > > This is

Re: Multiple timezone support for datetime representation

2011-09-06 Thread Paul McMillan
> I'm going to use the same trick used by USE_L10N and explained by Anssi: set > USE_TZ to False in global_settings.py and to True in the template of > settings.py. This preserves backwards compatibility but the new code is the > default for new projects. This isn't gonna work because your new

Re: Multiple timezone support for datetime representation

2011-09-06 Thread Aymeric Augustin
Thanks Paul, Anssi, Mikhail and Daniel for reviewing the proposal! Here are some answers to your remarks. On 3 sept. 2011, at 20:19, Paul McMillan wrote: > My main concern with your proposal is that it may require two > different code paths for a lot of code. Currently, my best guess is:

Re: Multiple timezone support for datetime representation

2011-09-04 Thread Daniel Swarbrick
I'm wholeheartedly on +1 on this. @Anssi Kääriäinen, re your localtime meeting example: this type of scenario has been discussed on this list previously, and the generally acknowledged solution is to use separate date and time fields, neither of which (on their own) have a concept of timezone. @A

Re: Multiple timezone support for datetime representation

2011-09-03 Thread Mikhail Korobov
Great job on summarizing the issue! I have one concern though. Can you please explain why is USE_TZ option better than introducing e.g. UtcDateTimeField? USE_TZ=True will break all existing code (including external apps) which relies on django 1.3 documented DateTimeField behavior, this can be

Re: Multiple timezone support for datetime representation

2011-09-03 Thread Anssi Kääriäinen
On Sep 3, 9:19 pm, Paul McMillan wrote: > Hi Aymeric, > > First, thanks for all your triage work on track, it's very much > appreciated. This is a large proposal, but I think it covers the issue > pretty completely. > > I agree with your approach of using UTC internally and converting on output. >

Re: Multiple timezone support for datetime representation

2011-09-03 Thread Paul McMillan
Hi Aymeric, First, thanks for all your triage work on track, it's very much appreciated. This is a large proposal, but I think it covers the issue pretty completely. I agree with your approach of using UTC internally and converting on output. My main concern with your proposal is that it may req

Multiple timezone support for datetime representation

2011-09-03 Thread Aymeric Augustin
Hello, The GSoC proposal "Multiple timezone support for datetime representation" wasn't picked up in 2011 and 2010. Although I'm not a student and the summer is over, I'd like to tackle this problem, and I would appreciate it very much if a core developer accepted to m