On 11.4.2011 18:59, Drise wrote:
How would I go by doing that?

On Apr 11, 10:42 am, pbreit<pbreitenb...@gmail.com>  wrote:
I wasn't aware that validators could be used like that. Perhaps just query the 
db?
Hello,

as pbreit commented validators can´t be used like that. They are used when you are using forms, to validate that the data you have entered/selected complies to some rules.

To check if a user has rated already you query the database and if no rows found the user can rate.

rated = db(db.hasrated.user == request.args[0]).select()

if len(rated) == 0:
        #user can rate

else:
        #user already rated, can´t rate anymore

Is this enough?


Kenneth




Reply via email to