as an aside, wiki.web2py.com seems to be stuck generating tickets...
On Mar 5, 8:14 am, mdipierro wrote:
> change this
> selected_choice.update_record(votes=db.choice.votes+1)
> into
> selected_choice.update_record(votes=seleted_choice.votes+1)
>
> Mind that I tried to code the original D
change this
selected_choice.update_record(votes=db.choice.votes+1)
into
selected_choice.update_record(votes=seleted_choice.votes+1)
Mind that I tried to code the original Django app so that it would
make the original SQL queries. That is way it does not work on GAE.
On Mar 5, 12:58 am, mdm
Thanks. Now the pages display successfully that show the poll results
and the voting options: http://localhost:8080/Polls/default/detail/9
and http://localhost:8080/Polls/default/results/9.
But when I voted, I got errors with http://localhost:8080/Polls/default/detail/9
- my vote wasn't saved. The
I think the problems is that poll doesn't have a foreign key to
choice, it's the other way around. Try this:
{{poll_choices = db(db.choice.poll==poll.id).select()}}
{{ for choice in poll_choices: }}
{{=choice.choice }} -- {{=choice.votes }} vote{{if
choice.votes!=1:}}s{{pass}}
{{ pass }
On Ma
db.define_table('poll',
Field('question',length=200),
Field('pub_date','datetime',default=request.now,writable=False))
db.define_table('choice',
Field('poll',db.poll),
Field('choice',length=200),
Field('votes','integer',default=0))
db.define_table('recorded_votes
Can we see your model?
On Mar 1, 9:05 pm, mdmcginn wrote:
> From index.html:
> Latest Polls
> Answer the question [vote] [results]
>
> When I click on [results], I'm sent
> tohttp://localhost:8080/Polls/default/results/67
>
> ERROR 2010-03-02 02:54:08,609 restricted.py:53] In FILE: /home/
> m
>From index.html:
Latest Polls
Answer the question [vote] [results]
When I click on [results], I'm sent to
http://localhost:8080/Polls/default/results/67
ERROR2010-03-02 02:54:08,609 restricted.py:53] In FILE: /home/
michael/mycode/google_appengine/web2py/applications/Polls/views/
default/re
Can you show us the traceback. It should work.
On Mar 1, 3:40 am, mdmcginn wrote:
> The Polls application (fromhttp://wiki.web2py.com/Polls_Tutorial)
> doesn't work in GAE, though I can't read the tickets. The controller
> seems to be okay, but not the view (detail and results.html).
>
> Controll
8 matches
Mail list logo