Monday, April 25, 2016

Re: FieldError: Invalid order_by arguments: ['- pub_date']

On Mon, Apr 25, 2016 at 04:17:08AM -0700, gu99roax@student.chalmers.se wrote:
> Yes, that worked. Someone better fix that mistake in the tutorial.

I looked at the tutorial, but I didn't find any code example that
would contain an order_by call containing a space after the minus
sign. If there is such an example, could you point it out, so we can
fix it?

> Also the
> template for index.html is also wrong, by changing line 4 to
>
> <li><a href="{{ question.id }}/"> {{ question.question_text }}</a></li>
>
> it now works.

I'm not entirely certain which template you are referring to here,
since the third part of the tutorial iterates on the template for
polls/index.html, but assuming you mean the first version, both
"{{ question.id }}/" and "/polls/{{ question.id }}/" would be correct,
as long as you use the same URL patterns as described earlier in the
tutorial (i.e. if the correct URL is /polls/<id>/).

Cheers,

Michal

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20160425115033.GH435%40koniiiik.org.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment