DateTime().Time() gets Insufficient Privileges error, why?
I am trying to get the latest time in a Python Script. I declare: from DateTime.DateTime import DateTime But when I run: t = DateTime().latestTime() or t = DateTime().Time() I always get an Insufficient Privileges error. I have combed through the archives and the web and as far as I can tell this should work. What am I doing wrong? Thanks! Jamie
On 29 Dec 2005, at 04:53, Jamie O'Keefe wrote:
I am trying to get the latest time in a Python Script.
I declare:
from DateTime.DateTime import DateTime
But when I run:
t = DateTime().latestTime()
or
t = DateTime().Time()
I always get an Insufficient Privileges error.
Instead of trying to import DateTime just call ZopeTime on your context, which will give you back a DateTime object, like so: t = context.ZopeTime().latestTime() jens
--On 29. Dezember 2005 11:57:08 +0100 Jens Vagelpohl <jens@dataflake.org> wrote:
On 29 Dec 2005, at 04:53, Jamie O'Keefe wrote:
I am trying to get the latest time in a Python Script.
I declare:
from DateTime.DateTime import DateTime
But when I run:
t = DateTime().latestTime()
or
t = DateTime().Time()
I always get an Insufficient Privileges error.
Instead of trying to import DateTime just call ZopeTime on your context, which will give you back a DateTime object, like so:
t = context.ZopeTime().latestTime()
This also looks scary. Since you don't have to import DateTime you can use it really directly: t = DateTime().latestTime() -aj
Nevermind. I later found that I could not call HTTPConnection from my python script in Zope and ended up going straight to running it in python 2.3. Jamie On 12/28/05, Jamie O'Keefe <jokeefe@jamesokeefe.org> wrote:
I am trying to get the latest time in a Python Script.
I declare:
from DateTime.DateTime import DateTime
But when I run:
t = DateTime().latestTime()
or
t = DateTime().Time()
I always get an Insufficient Privileges error.
I have combed through the archives and the web and as far as I can tell this should work. What am I doing wrong?
Thanks!
Jamie
Thanks Andreas and Jens for the helpful tip. Jamie
participants (3)
-
Andreas Jung -
Jamie O'Keefe -
Jens Vagelpohl