Hi Aline,

I did not use Haystack but I am using ElastickSearch.
I carefully read you post on StackOverflow and see that search form returns
author of the post without `pk` key defined.

Did you check what is returned by ElastickSearch?
May be your SearchForm returns exactly what Elastick stores in its index? I
mean that post returned by SearchForm not the same as Post model? It can be
dictionary or something?

Sorry I do not have time to build test app to check my idea.

You can easily set up a break point and check what are the posts inside
your `post_search` view function.

Regards,
Constantine C.

On Sat, Oct 15, 2016 at 12:48 AM, Aline C. R. Souza <linecrso...@gmail.com>
wrote:

> Hello everybody,
>
> I am having a issue using Django + Haystack + Elasticsearch to perform a
> website search.
>
> I made a question on StackOverflow, but I had no satisfatory answer.
>
> The problem is in this line:
>
> by <a href="{% url 'blog.posts_by_author' post.author.pk %}">{{ post.author
> }}</a>
>
> post.author.pk works well when called by several views, but it is not
> resolved when called by the search.
>
> There is another way to get the pk of the author of the post?
>
> The link of the StackOverflow question: http:/
> /stackoverflow.com/questions/40033039/noreversematch-error-
> using-haystack-elasticsearch
>
> Can someone help me? Please explain in details, because I am new in
> Django, and in haystack, elasticsearch...
>
>
> --
> 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+unsubscr...@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/fb151afb-35a8-4ac4-a9e4-69f4419568c1%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/fb151afb-35a8-4ac4-a9e4-69f4419568c1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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+unsubscr...@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/CAK52boUrkqTgVTjcDqrFqoDeH0nO56HiSJ9HKvncu9bP%3DDF_Eg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to