Tuesday, December 26, 2017

Re: Search results in template

That appears to be it. I got content and all that on the simple template this time. 

I put values_list in there because that's the way it was done on the postgres full text search tutorial I was using. I assumed it was needed for rank, I never thought about it limiting me otherwise.
If I seem a little less enthused than I should be, it is only because I am getting a little tired and hungry, and was emotionally prepared to put this whole thing aside and had started working on something else.
But you have helped me tremendously, and I greatly appreciate it. Tomorrow I will play with it some more... unless my mood changes after I eat....  ;-)

THANK YOU!!!!

"None of you has faith until he loves for his brother or his neighbor what he loves for himself."

On Tue, Dec 26, 2017 at 9:19 PM, James Schneider <jrschneider83@gmail.com> wrote:



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 a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/xSW1BjLXXSQ/unsubscribe.
To unsubscribe from this group and all its topics, 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.

--
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/CAKd6oBzskoyggu4LBHafufPXQ1QHeuNdQiUEZbD6zRO7-fGWOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment