forked from yahyaaly151989/Mastering_Django
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing a full-text search engine with Django and PostgreSQL
- Loading branch information
1 parent
5b0487e
commit 8a4919e
Showing
10 changed files
with
1,550 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{% extends "blog/base.html" %} | ||
{% load blog_tags %} | ||
|
||
{% block title %}Search{% endblock %} | ||
|
||
{% block content %} | ||
{% if query %} | ||
<h1>Posts containing "{{ query }}"</h1> | ||
<h3> | ||
{% with results.count as total_results %} | ||
Found {{ total_results }} result{{ total_results|pluralize }} | ||
{% endwith %} | ||
</h3> | ||
|
||
{% for post in results %} | ||
<h4> | ||
<a href="{{ post.get_absolute_url }}"> | ||
{{ post.title }} | ||
</a> | ||
</h4> | ||
{{ post.body|markdown|truncatewords_html:12 }} | ||
{% empty %} | ||
<p>There are no results for your query.</p> | ||
{% endfor %} | ||
<p><a href="{% url "blog:post_search" %}">Search again</a></p> | ||
|
||
{% else %} | ||
<h1>Search for posts</h1> | ||
<form method="get"> | ||
{{ form.as_p }} | ||
<input type="submit" value="Search"> | ||
</form> | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+45 Bytes
(100%)
Module03/mysite/mysite/__pycache__/settings.cpython-311.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.