Tuesday, December 26, 2017

Re: Search results in template




And the result:


!DOCTYPE This is the first page

  • ('2017-10-09 Incentive, a further review', 0.151982)

  • ('2017-11-14 Pulling The Trigger', 0.151982)

  • ('2017-10-05 A Failure of Incentive?', 0.121585)

  • ('2017-10-20 spider refactor', 0.121585) And now for something completely different...

    • :

    • :

    • :

    • :


<<>>


So this looks like a variable problem, but I don't claim to understand that, either. I mentioned earlier on this thread that different variables gave me different results, but everyone says that can't be it.



Ah. Are you still chaining .values_list() to your query in the view? That would explain the output above.

The loop is built with the assumption that we have full objects from the ORM, but because we chained .value_list(), we're actually getting a list of tuples containing two values.

Your templates are built in the same manner. Can you run the second loop again with .values_list() removed from the query in the view?

-James

--
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/CA%2Be%2BciWjdFDwUPT7-60Gk1OfaejZeoFAsDXZpgXjp0mQ26C30g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment