Advanced search
m
master199Nov. 28, 2018, 11:03 a.m.

AndroidListView, как сохранить позиции после поиска?

ListView, activity, Search, position

ListView, как сохранить позиции после поиска?

Evgenij LegotskojJuly 5, 2018, 3:05 a.m.

DjangoDjango - Tutorial 035. Different templates for rendering different types of content in the search results

Django, template, content, Search

Constant visitors of the site who use the search on the site, probably noticed that the display of articles differs from displaying comments in the search engine issue of the site. This was achieved by the fact that each content type has its own template for rendering, which is substituted for the rendering of the page, depending on what content was found in the search.

Let's look at the example of issuance.

You see, here the presentation of the comment differs from the article, but they are output in the framework of one search issue, as was done in the previous article.

But this is done much more elegantly than selecting via if else . Honestly, I myself really like this decision.

Evgenij LegotskojJuly 4, 2018, 2:38 a.m.

DjangoDjango - Tutorial 034. How to do a search on several data models

Search, Model, QuerySet, Django

In previous articles, we considered how to do a search on the site on the site. Namely:

But what if you have more than one type of content. You can have articles, comments, forum and messages on the forum. How then to be?

If you want to do everything yourself, without using third-party libraries, then you will need to do a search on all the necessary models and combine the result. I have done exactly the same on the site.

Evgenij LegotskojJan. 16, 2018, 2:19 a.m.

DjangoDjango - Tutorial 032. Advanced search options

Django, Search

The site has functional, thanks to which you can ask a question on the forum with an article on the site to which this question relates in one way or another. This is done through external keys from the topic on the site's forum to articles. In this case, the foreign key may not be.

article = models.ForeignKey(Article, verbose_name=_("Статья"), null=True, blank=True)

Thus, at the end of the article you can see how many questions on the forum are given for this article. This allows you to improve the page linking of the site, and also gives users the opportunity to find similar questions about the article they are studying.

The main question for me was how to implement a list of topics on the forum so as not to overload the site with additional pages that would complicate the navigation. The solution was simple enough: add a search option on the forum with additional advanced search keys. Namely, the article key, which would define the article id , for which you want to filter out all topics on the forum that contain a foreign key for an article with this id .

This approach allowed to change the main page of the forum, to expand the functionality of the forum with an additional search and to exclude the addition of a new presentation and template for new pages.

Evgenij LegotskojOct. 4, 2016, 12:09 p.m.

DjangoDjango - Tutorial 012. Site search with pagintaion based on Django

Поиск, Postgres, Search

For the organization of the search on the site, which is based on the Django , and uses a PostgreSQL database, you can use the module to search through the database that comes with Django. Especially because the search for full-text search provides sufficiently for a small site.

But in order to issue search queries looked more like the home page, the ability to add pagination of pages of issue, and the results will be displayed on the 10 pieces on the same page. And for that, we will also use django_bootstrap3 module.

As a result, we have the following plan of action:

  1. Adding an application to search for the organization;
  2. Adding search url;
  3. Add a search box;
  4. This search page template.
  5. Describes the representation for issuing the search processing;
Timeweb

Let me recommend you the excellent hosting on which EVILEG is located.

For many years, Timeweb has been proving his stability.

For projects on Django I recommend VDS hosting

View Hosting
L

C++ - Test 001. The first program and data types

  • Result:80points,
  • Rating points4
DTs

C++ - Test 001. The first program and data types

  • Result:46points,
  • Rating points-6
SB

Qt - Test 001. Signals and slots

  • Result:94points,
  • Rating points8
Last comments
JaO

Как соответствовать новым требованиям Google Play

Ку всем! Вопрос! Как с помощью JNI вызвать оплату на android устройстве? Попробовал Qt Purchasing вроде пошло... но android пишет что библиотека устарела. В qt6 пока поддержки purchasing нет. Р…

Django - Tutorial 014. Displays a list of popular articles on Django

Я как понял, этот метод создает статистику каждый день (на каждый день), не удаляя старые данные за день и выводит все данные за сегодняшние просмотры у всех статей?

Qt/C++ - Lesson 006. QSqlQueryModel – Tables in Qt with SQL-query

Изменить запрос при создании модели.
L
  • Livis
  • May 30, 2021, 1:18 p.m.

Django - Tutorial 001. Deploying a site on Django + PostgreSQL + Gunicorn + Nginx

Отвечал на все команды после sudo service supervisor start Исправил таким образом sudo killall supervisordsudo supervisord -c /etc/supervisor/supervisord.conf
D

Django - Tutorial 001. Deploying a site on Django + PostgreSQL + Gunicorn + Nginx

Это на какую команду так отвечает?
Now discuss on the forum
v
  • vika
  • June 17, 2021, 12:19 a.m.

Вопрос новичка ui-форма

все получилось. создала обьект, исправила ошибки и все заработало. спасибо, что есть с кем поговорить.
s

Ключевое слово class

Разобрался,на стаковерфлоу нашел топик и понял почему так происходило .
KM

Django как воспользоваться результатом метода?

Priv = 2020 Now = 2021 Next = 2022 Rok = ( (None, "Nie wybran"), (Priv, '2020'), (Now, '2021'), (Next, '2022') ) Rok = models.IntegerField(choices=Rok, de…

QScrollArea dynamically add QCheckBoxes

Всё правильно. Это просто спамер, который отправился в вечный бан.

Папка с шаблоном сайта

Есть проект с поддержкой динамического создания поддоменов. Как назначить разные пути к шаблонам в templates from django.shortcuts import renderfrom horticulture.utilities import get_horticu…
About
Services
© EVILEG 2015-2021
Recommend hosting TIMEWEB