[Zope] Quick question on ZSQL methods...

David Kankiewicz i173327@thegrid.net
Wed, 08 Sep 1999 15:59:57 -0700


jcoleman@austin.rr.com wrote:
> 
> I was writing a SQL method to pull one record out of a database that
> contains account information for the current authenticated user, and
> it's not recognizing the <!--#var AUTHENTICATED_USER--> in the ZSQL
> method:
> 
> select * from accounts
>  where name = '<!--#var AUTHENTICATED_USER-->';
> 
> Zope tells me:
> 
> Error, exceptions.KeyError: AUTHENTICATED_USER
> SQL used:
> Could not render the query template!
> 
> Substituting <!--#var AUTHENTICATED_USER--> with an actual name works
> fine.  Any ideas on how to get this to work?  Or am I going about this
> all wrong?
> 
I believe the correct way to get the username would be:

<!--#var "AUTHENTICATED_USER.getUserName()"-->

untested..


Regards,
David


> Thanks,
> John
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
> 
> For developer-specific issues, zope-dev@zope.org -
> http://www.zope.org/mailman/listinfo/zope-dev )