Post tagged: django orm

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.