April 28, 2019, 1:36 p.m.

Django

Django, Model, Reset

In the process of developing a project on Django, we may encounter an unpleasant situation when some packages and modules were removed and, accordingly, models from these packages were no longer used. But at the same time, squash of application migrations does not allow removing these packages, since migrations have many circular dependencies. As a result, removing unnecessary packages becomes a rather difficult task. Since resolving such dependencies becomes a non-trivial task. For me, such an unpleasant package was Django CKEditor, which was present almost everywhere. As a result, this package due to migrations remained for quite a long time in the list of requirements.txt, although in fact it was not used on the site at all.

April 24, 2019, 7:42 a.m.

Django

Django, Application, Model

I would like to share one of the possible way for moving the data model from one application to another.

Immediately, I note that this version of the data model transfer is not 100% working and you may need additional manual editing of the tables to correctly set the Content Type. Since any such modifications are fraught with data loss for GenericForeignKey relationships.

In my case, GenericForeignKey was not used, so there was no such problem.

July 4, 2018, 6: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.

Nov. 24, 2015, 2:11 p.m.

QML

База данных, SQLite, Qt, QML, Android, DataBase, Model, View, MVC

A small example to work with the database in QML Qt. This lesson brings together information on the use of signals and slots in the Qt QML , access to C++ classes from QML layer implementation of the application interface on QML, as well as the implementation of the model/view for the database tables.

The database contains a table with a list of people, which has four columns:

  • id (INTEGER) - a unique record number;
  • FirstName (VARCHAR (255)) - First Name;
  • SurName (VARCHAR (255)) - Last Name;
  • Nik (VARCHAR (255)) - Nik name.

The application must implement removing and adding records to the database through the application interface. To add records to the database three fields for data entry will be used and a button that initiates the addition of data to an SQL database. Adding entries to the table through a wrapper class designed for this application is present in metodom.Takzhe ListModel class that implements the model of data representation for the information display in the TableView in QML layer.

Nov. 9, 2015, 9:03 a.m.

QML

ListView, ListModel, TextInput, Model, Delegate, QML, Qt, Android, View

Working with the ListView in QML is a fairly common aspect in the development of Android applications, since many applications have in their functional building lists of data, records, settings, etc. It is also true in developing a Desktop applications with QML principle would be the same for both platforms.

For its consideration of the transfer of information in the list offer carefully consider the following scenario of interaction with the ListView .

The principle of view data in the ListView

ListView object has two important properties:

  1. delegate - which determines the appearance of a single element ListView
  2. model - which placed the data of each element

The transmission model can be used ListModel object that contains the data for each item in the list. The data assigned to variables that have been assigned to certain properties of the objects in the delegate. In the figure below has two delegate objects Text, text properties which the variables text_first and text_second assigned. These variables determine which will be substituted data from each ListElement in ListModel . As can be seen from the figure, each ListElement has two properties, the name of which is identical to the variables that are assigned to the delegate. In fact, these variables are roles, which put a value of ListModel . So we get ListView with text fields, which are filled with the data that have been made in each ListElement in ListModel .

m
May 19, 2019, 1:49 a.m.
mahhaki

Qt - Test 001. Signals and slots

  • Result:78points,
  • Rating points2
S
May 17, 2019, 1:14 p.m.
SunBro

Qt - Test 001. Signals and slots

  • Result:42points,
  • Rating points-8
b
May 17, 2019, 4:18 a.m.
banana

C++ - Тест 003. Условия и циклы

  • Result:57points,
  • Rating points-2
Last comments
May 20, 2019, 7:20 p.m.
Евгений Легоцкой

Добрый день! Вы не думали разместить репозиторий проекта на GitHub?
P.
May 18, 2019, 2:03 p.m.
PELMYACH .

Спасибо большое! Вскоре буду разбираться!
May 18, 2019, 9:13 a.m.
Евгений Легоцкой

Добрый день! Отнимать значение общего счётчика можно в деструкторе класса кнопки QDynamicButton::~QDynamicButton(){ ResID--;} При этом я бы ещё переустанавливал значения вс...
P.
May 14, 2019, 10:33 p.m.
PELMYACH .

Здравствуйте!А не подскажите, как можно при удалении какой либо кнопки, у щётчика отнять значение?Дабы например четвёртой кнопке соответствовал ID 4, а не 5 скажем
May 6, 2019, 6:39 a.m.
Евгений Легоцкой

Добрый день. Этот урок для Qt Quick Control версии 1, Вы используете вторую версию. Здесь style уже нет, кастомизацию можно делать уже или черещ соответствующие property или через ...
Now discuss on the forum
May 21, 2019, 1:51 p.m.
Евгений Легоцкой

Добрый день! Вот пример создания динамической библиотеки в Qt . Да, там показан один класс, но абсолютно ничего не меняется, сколько бы классов вы там не имели. Ва...
May 20, 2019, 8:43 a.m.
Михаиллл

Кинул библиотеки в папку с проектом и в папку к компилируемым файлам.В файле проекта прописал так, но все равно выдает ту же ошибку QT += core gui networkgreaterThan(QT_MAJOR_VERSI...
May 20, 2019, 1:47 a.m.
linq

Что вы понимаете под статической сборкой приложений? В какой среде?
May 19, 2019, 10:52 a.m.
Евгений Легоцкой

Если честно, то мне нужно самому время потратить, чтобы глянуть это дело. Я использовал Flutter для разработки, а не Qt. Просто исходя из опыта, могу сказать, что по большей части всё на эмуля...
May 16, 2019, 11:08 p.m.
BlinCT

Решил через indexOf сделать. Возвращает или номер позиции где нашел символ или строку или -1 если не найдено.

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

EVILEG
About
Services
Join us
© EVILEG 2015-2019
Recommend hosting TIMEWEB