[z3-five] Some problems I found porting Silva views
Martijn Faassen
faassen at infrae.com
Tue Jun 22 18:08:31 MEST 2004
Guido Wesdorp wrote:
> I did some work to get some Silva views to work in Five, and overall I
> was surprised about how easy it was. However, I did run into some
> unexpected problems:
>
> 1. in tal there's this repeat thing, which allows to ask properties
> about a certain repeat. For instance, if there's a 'tal:repeat="foo
> bar"' somewhere, you can use 'repeat/foo/number' to get the index of the
> current processing element. These properties, however, are unaccessible
> because there's a Zope 3 security wrapper in the way.
>
> 2. A similar problem occurs with the 'modules' element, some Zope 3
> security wrapper prevents it from being usable
Okay, looks like my using Zope 3's zope.app.pagetemplate was not as easy
as I hope; some of this code evidently does explicitly does Zope 3
security wrapperish stuff..
Looks like we may have to end up copying zope.app.pagetemplate ourselves
and ripping out any security stuff to make this work smoothly in Five.
I'll study the code some more to see how complicated it is; additional
pairs of eyes are of course welcome. :) An alternative is to identify
the points in which this takes place and discuss with Jim ways to make
Zope 3 more flexible. This is of course preferable from a technical
point of view, but has a time & coordination cost.
> 3. request.AUTHENTICATED_USER isn't set properly, it returns
> Unauthenticated (or what is it) even though the client has logged in.
> AccessControl.getSecurityManager.getUser() does return the correct user
> object (so that's also a work-around for the problem, perhaps even
> better than using the AUTHENTICATED_USER var).
Right, as I discussed with Guido, we might simply decide not to support
AUTHENTICATED_USER and refer people to getSecurityManager() instead.
This might need to end up in some FAQ document.
> 4. (minor one and discussed by faassen on the channel) form vars aren't
> passed to methods as arguments, so for a request to
> 'some_method?foo=bar' some_method is called without the 'foo' argument,
> to get it's value one needs to use something like 'request['foo']'
Right, the question is here is: what does the Zope 3 Publisher do? If it
turns REQUEST values into arguments automatically, we need to trick the
Zope 2 publisher to do the same. This is possible as Python Scripts are
doing something similar. Zope 3 may however not do any such thing.. Does
anyone know?
> That's what I ran into so far, I guess more will follow later... I don't
> know if I'm able to fix any of the problems mentioned, I'll have a go at
> it later but I thought it would be wise to report them so that they're
> at least known...
Yes, it's a good way to start a discussion. Some of these problems are
tricky enough to bear some discussion before we hack our way towards an
answer. :)
Thanks Guido!
Regards,
Martijn
More information about the z3-five
mailing list