You sort-of offer the solution yourself, you need to store the fact that a user has voted for a specific article. If they try to vote again, tell them 'no.'
I would really suggest you try to work-out some way to accomplish that before asking for more help, it will help you learn a lot to struggle through it a bit. Robert On Mon, Jan 17, 2011 at 17:36, Zeynel <[email protected]> wrote: > On Jan 17, 5:11 pm, "Brandon Wirtz" <[email protected]> wrote: > >> Authenticate the user, store their vote, if they vote a second time it >> changes their vote. Very easy. > > I don't understand. I authenticate user with > > user = users.get_current_user() > > if user: > greeting = ("%s (<a href='%s'>sign out</a>)" % > (user.nickname(), users.create_logout_url(self.request.uri))) > > so a visitor can vote only if authenticated. > > Then I store the vote: > > item.vote +=1 > item.put() > > for that article. > > But I don't store that the user voted for that article; the way it is > now the user can vote on the same article again. > > Can you explain a bit more what you mean? > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
