Oct. 8, 2018, 5:16 a.m.
Evgenij Legotskoj

Django

Добрый день, дорогие пользователи EVILEG!

Вот и я решил задать вопрос на своём форуме. Надеюсь на отклик. Давайте обсудим один вопрос.

Мне не даёт покоя одна мысль, где лучше прописывать Generic вьюшки в Django.

В документации есть два варианта, как использовать Generic в…

July 31, 2018, 2:56 a.m.

Django

ESNF-ICO, ESNF-DOC, ESNF-C, ESNF, ESNF-LD, Django, EVILEG

There was probably something that many users of the resource EVILEG would like to see among Web developers.

It was decided to open the sources of EVILEG, especially since I repeatedly received requests to show the source of the resource and even suggestions for the feasible improvement of the site code.

Thus, weighed all the pros and cons, I decided that sending the source code to EVILEG in Open Source is not such a bad idea.

July 16, 2018, 3:15 a.m.

Django

Social, Google, Django, Google API

The second social network through which you can authenticate on the site will be Google+.

I will not go into all the details of setting up and installing the Python Social Auth Django battery, as it was discussed in the previous article . But I note that this time the connection took only half an hour.

However, setting up access through the Google API was more complex than for VKontakte.

July 5, 2018, 3:05 a.m.

Django

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.

July 4, 2018, 2:38 a.m.

Django

Search, QuerySet, Django, Model

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.

May 17, 2018, 11:50 a.m.

Django

Django, filter, django-bootstrap3, ListView

Благодаря FilterView можно упростить и уменьшить код для отображения товаров, продуктов и тд. Что позволит уменьшить код в разы! Сначала я использовал ListView и писал много когда для того, чтобы можно было бы отфильтровать по запросам. Пока один из хороших знакомых мне не посоветовал django-filter . Прочитав про него больше я понял что это то что нужно. После, когда я хотел все свои вьюшки использовать как обьект. Это меня немного озадачило, пока знакомый снова меня не выручил подсказкой об использовании FilterView, а теперь более подробней обсудим её:

May 15, 2018, 10:07 a.m.

Django

Django, Snippet

In Django shortcuts there is a function get_object_or_404 , but there is no function get_object_or_none , which can be useful in the case when we do not want to cause error 404 immediately, but we need to perform some actions in case the object does not exist in the database data.

It was possible to find a discussion on the Internet, where developers wrote that such a functional can be easily implemented as a function until a function within the project of the developer and it is not required to introduce it into the main code.

Feb. 28, 2018, 4:57 a.m.

Django

сортировка, sort, Django

To improve the usability of article sections, we sorted articles by date, title, and number of views. In addition, the ability to find information on articles of the section has been added. This feature is implemented through several checkboxes that add the column names for sorting in the URL of the page, respectively, the page is reloaded.

For example, there are several columns in the data model

  • title
  • pub_date
  • views

For them we will do the sorting, which in the usual query would look like this

Article.objects.all().order_by('title', 'pub_date', 'views')

But since we use checkboxes, sorting options can be present, and I can be absent. But do not we write if else blocks for every combination of checkboxes? Of course not.

Jan. 25, 2018, 12:45 a.m.
Vadim Polshkov

Django

Здравствуйте.
Не могли бы вы написать, как делали на своем сайте интернационализацию и локализацию? В принципе я ее сделал, но у меня не получается сделать как у вас выбор языка в навбаре - как это реаливать? Насколько я понимаю это нужно создать несколько url один под ru, второй под en и…

Jan. 16, 2018, 2:19 a.m.

Django

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.

Looking for a Job?
14,000.00 руб. - 40,000.00 руб.
Разработчик Qt
Annino, Moscow Oblast, Russia
5,000.00 руб. - 15,000.00 руб.
Дизайнер
Moskovskiy, Moscow, Russia
25,000.00 руб. - 30,000.00 руб.
Разработчик Qt/C++
Barnaul, Altai Krai, Russia

For registered users on the site there is a minimum amount of advertising

A
Aug. 22, 2019, 11:24 p.m.
Aleksandr73

Qt - Test 001. Signals and slots

  • Result:47points,
  • Rating points-6
Aug. 21, 2019, 10:23 a.m.
Andrej Ermoshin

C++ - Test 002. Constants

  • Result:58points,
  • Rating points-2
Aug. 21, 2019, 10:15 a.m.
Andrej Ermoshin

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

  • Result:86points,
  • Rating points6
Last comments
Aug. 19, 2019, 7:41 a.m.
Andrej Jankovich

это проблема дистрибутива, попробуйте установить через пакетный менеджер snap Суть проблемы: libQt5Core которая лежит в дистрибутиве требует версию glibc >= 2.25 у вас видимо …
b
Aug. 18, 2019, 6:09 a.m.
bbb116

cqtdeployer /home/aleks/CQtDeployer/bin/cqtdeployer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /home/aleks/CQtDeployer/lib/libQt5Core.so.5) linux mint …
D
Aug. 17, 2019, 9:04 a.m.
Damir

github ChekableTView Правой групповая смена значения при перетаскивании левой как обычно.
Aug. 16, 2019, 1:03 p.m.
Evgenij Legotskoj

Потому, что в минуте 60 секунд
Aug. 16, 2019, 12:16 p.m.
Dmitrij

а почему делитель 60000, а не 1000?
Now discuss on the forum
Aug. 24, 2019, 7:21 a.m.
Evgenij Legotskoj

Не помню, давно уже с QML не работал, по-моему, обычно пишет в консоль, что не находит файл. В любом случае какую-то ошибку в консоль выкидывает. Но если честно, если у вас проект будет ак…
BG
Aug. 24, 2019, 4:27 a.m.
Brjus Gliff

Спасибо, вначале в документации было не понятно что к чему, теперь разобрался
I
Aug. 21, 2019, 8:36 a.m.
Intruder

Александр, мне не нужно перебирать. Вы говорите правильно, сначала я написал избыточный код просто не подумав. Задача такая, мне нужно просто переложить из QMap в атрибуты xml тега все, что там …
Aug. 21, 2019, 3:16 a.m.
nayk1982

Если Вы разрабатываете какую-то универсальную утилиту, которая вообще не привязана к логике, тогда как вариант: 1. Получить список таблиц через QSqlDatabase::tables 2. Для каждой табли…
EVILEG
About
Services
© EVILEG 2015-2019
Recommend hosting TIMEWEB