[Zope] How To: get a list of emails from a database based on acl_users
folder
folder
tom smith
tom@othermedia.com
Thu, 21 Sep 2000 15:16:56 +0100
hi guys,
thanks for everyones help. I was trying to fish some values (email
addresses) from database based on the value of someone's username in an
acl_users folder. I got it working, I think part of the problem is that
ZSQL Methods seem to be real picky about their params. For example "theName"
doesn't work as a param but "theName:string" does.
Anyway, here's my code
tom
dtml_method
---------------------------------------------
<dtml-in "theOTHERintranet.acl_users.getUserNames()">
<dtml-let uName="_['sequence-item']">
<dtml-in "get_email(theName=uName)">
<a href="mailto:<dtml-var Email>"><dtml-var UserName></a><br>
</dtml-in>
</dtml-let>
</dtml-in>
-----------------------------------------------
sql_method "get_email"
--------------------------------------------
params :theName:string
select UserName, Email from tblUsers
where
UserName = '<dtml-var theName>';