[Zope] IP Registering in a Poll: Attribute Error
Avus
avvus@netscape.net
30 Aug 99 16:38:13 MET DST
Hi,
I'm trying to implement registering on IP addresses for the Poll product (from
the Product API tutorial), but Zope won't let me :-(
As a REQUEST object is passed to the vote() method in Poll.py, I can get the
remote IP via
remote_ip=REQUEST['REMOTE_ADDR']
#and print it e.g. like
if REQUEST is not None:
return MessageDialog(
title='Vote Accepted',
message='Yep. Your vote has been accepted, '+remote_ip,
action =action,
)
However, I couldn't store the IP addresses in a list. If I try to use a list
like self.voted_ips=[] (like the self.votes={} dictionary already there) doing
a
self.voted_ips.appent(remote_ip)
Zope will complain when I commit a vote:
--8<--
Sorry, an error occurred.
Traceback (innermost last):
File lib/python/ZPublisher/Publish.py, line 877, in publish_module
File lib/python/ZPublisher/Publish.py, line 590, in publish
(Info: /test/testpoll/testpoll/vote)
File /usr/home/me/zope/lib/python/Products/Poll/Poll.py, line 104, in vote
(Object: RoleManager)
AttributeError: voted_ips
-->8--
Do I have to set special permissions somewhere? I'm working with Zope 1.10.3.
Thanks
Avus
____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.