[Zope] on dates

Tino Wildenhain tino at wildenhain.de
Mon Oct 11 14:41:22 EDT 2004


Hi,

Am Mo, den 11.10.2004 schrieb massimop at users.berlios.de um 20:13:
> On Mon, 2004-10-11 at 18:57 +0100, Cliff Ford wrote:
> > You could try writing a wee Python script. This one gets the date from 
> > the query:
...
> ## Script (Python) "formatdate_py"
> ##bind container=container
> ##bind context=context
> ##bind namespace=
> ##bind script=script
> ##bind subpath=traverse_subpath
> ##parameters=d
> ##title=
> ##
> # Import a standard function, and get the HTML request and response
> objects.
> from Products.PythonScripts.standard import html_quote
> request = container.REQUEST
> RESPONSE =  request.RESPONSE
> 
> return d.day
           ^^^^
you have to call it anyway. E.g. d.day()


> and then called it from a page template with:
> 
> <i tal:content="python: here.formatdate_py(item.data)"></i>
> 
> but it's sadly the same...
> 
> <<You are not allowed to access 'day' in this context>>
> 
> and it dosn't change if I pass 'item' to the script an access the field
> 'data' inside it

Looks a bit like the database adaptor you use has a bug here.
Or did you perhaps screw up on permissions a bit? 

Regards
Tino



More information about the Zope mailing list