Post tagged: django

Django ORM's "unaccent" database lookup for Postgres

Besides case-independent database lookups using __iexact, Django's ORM can do accent-independent lookups too, using __unaccent. However, this only works well for relatively small datasets and is limited to PostgreSQL functionality.

Using Python's "operator" library to fetch lists from database tables

Efficient way to filter a Django database table with only one query when using a list of tuples as selector values. Makes use of the Python's "operator" library.

Django Rest Framework with Angular Material Starter SPA

The basic steps to setup a Django-powered RESTful back-end and a Angular-powered front-end that follows Google's Material Design specifications.

Django image upload to dynamic path

How to use Django's upload_to with dynamically created path and filename, based on the model instance the file is attached to.