Tag | django

  1. Django: Count Aggregates with Conditions

    In Django, One-to-Many relations are modeled by the ForeignKey. Under some circumstances, we may wish to collect some information (e.g. count, min, max, avg, etc) from related objects. For example, in a blog app, we may wish to build a table which lists the title and the number of …


  2. Full-text Search with Django and PostgreSQL

    Django has several PostgreSQL database functions to support full-text search. If you are using PostgreSQL as the database backend, then it is easy to add full-text search to your Django app.

    In this post, I would like to build an demo app with full-text search. This post covers several PostgreSQL-specific …


  3. Django ORM and Updating Counters

    Counters are common in website development. Most websites collect the number of page views with counters. E-commerce websites keep track of the quantity of a commodity with counters. However, it is hard to implement a correct counter with Django ORM.

    In this post, I would like to cover three ways …