[Zope] DateTime().Time() gets Insufficient Privileges error, why?

Andreas Jung lists at andreas-jung.com
Thu Dec 29 08:20:08 EST 2005



--On 29. Dezember 2005 11:57:08 +0100 Jens Vagelpohl <jens at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20051229/ee01a95d/attachment.bin


More information about the Zope mailing list