On Tue, May 19, 2009 at 7:36 PM, eric wrote:
>
> Hi
>
> I know it is just an tutorial, but I would like to know how you handle
> this issue.
>
> this is the code in 4th tutorial:
> {{{
> def vote(request, poll_id):
>p = get_object_or_404(Poll, pk=poll_id)
>try:
>selected_choice =
Hi
I know it is just an tutorial, but I would like to know how you handle
this issue.
this is the code in 4th tutorial:
{{{
def vote(request, poll_id):
p = get_object_or_404(Poll, pk=poll_id)
try:
selected_choice = p.choice_set.get(pk=request.POST['choice'])
except (KeyError,
2 matches
Mail list logo