Zope ZSQLMethod Question
Kapil Thangavelu
kthangavelu at earthlink.net
Mon Sep 11 19:09:42 EDT 2000
Steve Williams wrote:
>
> Phil Harris wrote:
>
> . . .
>
> if in doubt always use the recognised method, in this case
> AUTHENTICATED_USER.getUserName.
>
> if in your SQL method you use <dtml-var
> "AUTHENTICATED_USER.getUserName()">,
> all will be well.
>
> If you haven't yet got the Zope Quick Reference, go get it now, you
> won't
> regret it. ;)
>
The ZQR can be found at
http://www.zope.org/Members/ZQR
> Well, actually, I knew that AUTHENTICATED_USER is an object, but I still
> can't seem to get it to work.
>
> I alternate between
>
> "can't render the query template"
>
> after fiddling with quotes, dtml-var vs. dtml-sqlvar, etc.
>
> and
>
> Zope Error
>
> Zope has encountered an error while publishing this resource.
>
> Error Type: NameError
> Error Value: AUTHENTICATED_USER
>
> Troubleshooting Suggestions
>
> This resource may be trying to reference a nonexistent object
> or
> variable AUTHENTICATED_USER.
> . . .
>
> when invoking an ZSQLMethod with <dtml-var
> "AUTHENTICATED_USER.getUserName()"> from, say, an index_html folder.
It would probably be helpful if you passed in the Authenticated User
object to the ZSQL Method. ZSQL Methods have a restricted namespace
compared to standard zope objects.
btw. in the future you might want to post these questions to the zope
mailing list.
Kapil
More information about the Python-list
mailing list