Quite often we have to write paginated or filtered blocks of information on page. For example, list of similar houses. It's rendered on server first, and later pagination is done with ajax.
In order to make, I used following setup:
So in order to edit one such block, we have to edit three files (apart from template) - tag, view, url.
I got annoyed by this and decided to create a decorator that would automate this process.
With this decorator, you just have to write one function that creates context. Tag and view are generated and registered automatically. Url params like
?obj_id=1 are declared in decorator and are processed automatically.
There are two most popular web frameworks in Python. There is the Django with lots of intelligent defaults and the Flask micro framework with complete freedom in the choice of modules. Let’s see, what django vs flask is in 2017.
SQL is a fairly complicated language with a steep learning curve. For a large number of people who make use of SQL, learning to apply it efficiently takes lots of trials and errors. Here are some tips on how you can make your SELECT queries better. The majority of tips should be applicable to any relational database management system, but the terminology and exact namings will be taken from PostgreSQL.