[Zope] Menu of Timezones
Andy
andy@agmweb.ca
Thu, 14 Feb 2002 15:04:38 -0800
If you read the DateTime docs there is absolutely hint of a method that
returns the list of time zones. Random guesses as to the function or
attribute normally doesnt work.
If you look in the time zone there are about a dozen ways of representing a
time zone. I would suggest hardcoding the ones you want.
http://www.zopezen.org/Source/Zope24/lib/python/DateTime/%7EDateTime.py#160
scroll down...
----- Original Message -----
From: "John Wheeler" <jdw27_42@hotmail.com>
To: <zope@zope.org>
Sent: Thursday, February 14, 2002 10:16 PM
Subject: [Zope] Menu of Timezones
> For an input form, I'd like to make a menu of time zones.
>
> I saw in Appendix B: API Reference of the Zope Book that there already is
a
> DateTime module function that returns a list of timezones, so I thought I
> could simply use <dtml-in> to go through the list, wrapping each
> sequence-item with <option></option>.
>
> I tried every combination I could think of but got an error every time:
>
> <dtml-in {below}> Error Name Error Value
> ================= ========== ===========
> DateTime.Timezones KeyError DateTime.Timezones
> Timezones KeyError Timezones
> "_.Timezones()" AttributeError Timezones
> "DateTime.Timezones()" NameError global name 'DateTime' is not
> defined
> "_.DateTime.Timezones()" AttributeError class DateTime has no attribute
> 'Timezones'
> "DateTime[Timezones]" NameError global name 'DateTime' is not
> defined
> "_.DateTime[Timezones]" NameError global name 'Timezones' is not
> defined
> "_.DateTime._Timezones()" SyntaxError Line 2: "_Timezones" is an
invalid
> attribute name because it starts with "_".
>
> I even tried writing a python method using "from DateTime import
Timezones"
> but got an ImportError: import of "Timezones" from "DateTime" is
> unauthorized.
>
> Is it just not possible to access Timezones() through the web? If I'd
have
> to go to an external method, I'll just hardcode the timezones into the
DTML
> method by hand.
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>