Login

Snippets by guglielmocelata

Snippet List

Custom Filter using filterspecs

This snippet is based on [#1051](http://djangosnippets.org/snippets/1051/). It adds filtering by existence of at least one related object. It is an example of how to simply subclass the FilterSpec class, in order to build a custom Filter. The comment in the code contains instructions on how to implement it in a real project.

  • django
  • filterspecs
  • custom filters
Read More

SQL Log Middleware - with multiple databases

This is an improvement of [joshua](http://djangosnippets.org/users/joshua/)'s [SQL Log Middleware](http://djangosnippets.org/snippets/61/). If you have more than one database connection, then all queries are logged, grouped by connection. If a connection has no queries, then it's not shown.

  • sql
  • middleware
  • log
  • multiple-databases
Read More

guglielmocelata has posted 2 snippets.