Back
Sep 23, 2010

OR and AND without django.db.models.Q

Vladimir Sidorenko
Vladimir Sidorenko

I just found out that orand andare defined for QuerySet. This means that to do queries union or intersection, you can do:

User.objects.filter(...) | User.objects.filter(...)
    User.objects.filter(...) & User.objects.filter(...)

More thoughts

Jan 12, 2017Technology
Making Custom Report Tables Using AngularJS and Django

In this article I will tell you how to create an interactive interface with a widely customized visual look and different filtering to view reports.

Pasha Volkov
Pasha Volkov
Aug 25, 2017Technology
How to Upload Files With Django

File upload works differently from simple form inputs, which can be somewhat troublesome for beginners. Here I'll show you how to handle uploads with ease.

Pasha Volkov
Pasha Volkov
Oct 11, 2010Technology
Char search in Emacs as in Vim

In VIM there is a command for char search: f. After first use it can be repeated with ;. I like to navigate in line with it. You see that you need to go to bracket in a middle of a line - you press f( and one-two ; and you are there. There's no such command in Emacs, so I had to write my own. I've managed even to implement repetition with ;.

Vladimir Sidorenko
Vladimir Sidorenko
Nov 21, 2016Technology
Crawling FTP server with Scrapy

Welcome all who are reading this article. I was given a task of creating a parser (spider) with the Scrapy library and parsing FTP server with data. The parser had to find lists of files on the server and handle each file separately depending on the requirement to the parser.

Rostyslav Stekh
Rostyslav Stekh