either you update the session with a counter and forbid voting if that 
variable is > some limit (but as soon as the session is erased (e.g. a 
clean cookie operation) the user will be able to vote again) or you build 
up on request.env.remote_addr (that is the ip address requesting the page) 
something that forbids voting.
Be careful with request.env.remote_addr because several users can use the 
same ip address cause they're behind a NAT (e.g. universities, companies, 
China :D).

Given that you require registration to access the site, the safest way is 
to save the amount of votes linked to the auth_user.id in a table and use 
that as a filter condition.

Il giorno mercoledì 15 maggio 2013 16:10:44 UTC+2, sasogeek ha scritto:
>
> the book states this "although it is easy to change this behavior if 
> visitors are authenticated, by keeping track of the individual votes in the 
> database and associating them with therequest.env.remote_addr of the 
> voter." at this link 
> http://web2py.com/books/default/chapter/29/11#Voting-and-rating
>
> How do I do that? I don't understand... but I need that feature. The app 
> I'm building with it is already live though. feel free to check it out if 
> you want :)
> http://sasogeek.pythonanywhere.com/uRate/default/index.html . However, I 
> really need the help! thanks
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to