:
>
> * Option-2 = 50 votes
> * Option-1 = 18 votes
>
>
> 4.)
> In Python shell I managed to accomplish that by doing like so:
>
> >>> p = Word.objects.get(pk=1)
> >>> p
>
> >>> p.altword_set.all()
> [, ]
>
> >>> *p.al
teSyntaxError
> Exception Value:
>
> Could not parse the remainder: '().order_by('-votes')' from
> 'poll.altword_set.all().order_by('-votes')'
>
>
>
> How do I write the correct syntax for ordering my list?
You can't. The temp
gt; How come when I replace this:
> {% for choice2 in poll.altword_set.all %}
> to this:
> {% for choice2 in poll.altword_set.all().order_by('-votes') %}
> then I get this error:
>
> Exception Type: TemplateSyntaxError Exception Value:
>
> Could not parse the re
-votes') %}
then I get this error:
Exception Type: TemplateSyntaxError Exception Value:
Could not parse the remainder: '().order_by('-votes')' from
'poll.altword_set.all().order_by('-votes')'
How do I write the correct syntax for ordering my list?
--
You
4 matches
Mail list logo