Re: [Zope3-Users] obtaining time zone from http request

2005-08-30 Thread Lennart Regebro
On 8/30/05, Gary Poster <[EMAIL PROTECTED]> wrote: > Yes, that's a reasonable solution for some apps, and generally a good > approach to remember. As you said, though, it's difficult to do it > in a non-hacky, general way. On the other hand, I might like to see > if I can use the trick to have a

Re: [Zope3-Users] obtaining time zone from http request

2005-08-30 Thread Gary Poster
On Aug 30, 2005, at 5:10 AM, Lennart Regebro wrote: Getting the timezone from request is probably impossible. Correct. You can't get *the* timezone. You can get the possible timezones, on the basis of the Accept-Language header. However, you can do it with javascript: or something like that. This could be hacked into the relevant webpages, but you still need a form... Maybe you can set it when you lo

Bug in i18n timezones (was Re: [Zope3-Users] obtaining time zone from http request)

2005-08-29 Thread Gary Poster
On Aug 29, 2005, at 7:18 PM, Alen Stanisic wrote: On Mon, 2005-08-29 at 09:50 -0400, Gary Poster wrote: And FWIW, once you get your browser settings correct, for the timezone part of the locale database, en-* is all the same--that is, if my locale is en-US, I get all en* locations (including

Re: [Zope3-Users] obtaining time zone from http request

2005-08-29 Thread Alen Stanisic
On Mon, 2005-08-29 at 09:50 -0400, Gary Poster wrote: > And FWIW, once you get your browser settings correct, for the > timezone part of the locale database, en-* is all the same--that is, > if my locale is en-US, I get all en* locations (including Casablanca, > Tokyo, and other interesting l

Re: [Zope3-Users] obtaining time zone from http request

2005-08-29 Thread Alen Stanisic
Thanks Stephan, Garry, I definitely remember selecting the correct time zone during the installation of my operating system but obviously picked the wrong language. Alen On Mon, 2005-08-29 at 09:50 -0400, Gary Poster wrote: > On Aug 29, 2005, at 6:39 AM, Stephan Richter wrote: > > > On Monday 2

Re: [Zope3-Users] obtaining time zone from http request

2005-08-29 Thread Gary Poster
On Aug 29, 2005, at 6:39 AM, Stephan Richter wrote: On Monday 29 August 2005 02:32, Alen Stanisic wrote: My self.request.locale object is set but seems to be wrong str(self.request.locale.id) => None)> while I'd expect it to be something like Australia/Sydney. Is this a default locale?

Re: [Zope3-Users] obtaining time zone from http request

2005-08-29 Thread Stephan Richter
On Monday 29 August 2005 02:32, Alen Stanisic wrote: > My self.request.locale object is set but seems to be wrong > > str(self.request.locale.id)  =>   > > while I'd expect it to be something like Australia/Sydney. > > Is this a default locale? No, your browser seems to be set incorrectly. Check y

Re: [Zope3-Users] obtaining time zone from http request

2005-08-28 Thread Alen Stanisic
My self.request.locale object is set but seems to be wrong str(self.request.locale.id) => while I'd expect it to be something like Australia/Sydney. Is this a default locale? Alen On Sun, 2005-08-28 at 23:30 -0400, Gary Poster wrote: > On Aug 28, 2005, at 10:59 PM, Stephan Richter wrote: >

Re: [Zope3-Users] obtaining time zone from http request

2005-08-28 Thread Gary Poster
On Aug 28, 2005, at 10:59 PM, Stephan Richter wrote: On Sunday 28 August 2005 21:10, Alen Stanisic wrote: what's the best way to obtain timezone from request object. I tried tz = pytz.timezone(ITZInfo(self.request)) but the adaptation failed. Getting a single time zone from the request is

Re: [Zope3-Users] obtaining time zone from http request

2005-08-28 Thread Stephan Richter
On Sunday 28 August 2005 21:10, Alen Stanisic wrote: > what's the best way to obtain timezone from request object. I tried > > tz = pytz.timezone(ITZInfo(self.request)) > > but the adaptation failed. Getting a single time zone from the request is not sensible. Requests know only about the locale.

[Zope3-Users] obtaining time zone from http request

2005-08-28 Thread Alen Stanisic
Hi, what's the best way to obtain timezone from request object. I tried tz = pytz.timezone(ITZInfo(self.request)) but the adaptation failed. Thanks Alen ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-us