• Posted on Грудень 02, 2011

Retrieving elements in a specific order in django

If you have a list of ordered ids and you want to turn them into an ordered result set you can use FIELD() in mysql:

SELECT * FROM addons
ORDER BY FIELD(id, 3, 5, 9, 1);

Read More

  • Posted on Лютий 10, 2011

Use custom admin filters in ModelAdmin

ModelAdmin now has a lookup_allowed method which is used to either allow a lookup or raise a SuspiciousOperation exception. Read More

  • Posted on Лютий 07, 2011

django-stdimage traceback “The ‘%s’ attribute has no file associated with it”

This traceback happening when you check file to __delete__, but file do not exist on file system Read More

  • Posted on Лютий 01, 2011

Django admin filter by ranges of ages

Adds filtering by ranges of dates birth in the admin filter sidebar Read More

  • Posted on Лютий 01, 2011

Django admin filter by ranges of dates with calendar

Adds filtering by ranges of dates in the admin filter sidebar. Read More

  • Posted on Листопад 18, 2010

How to expire session on browser close in django

django employs cookies to track the user session. settings.SESSION_COOKIE_AGE defines the session expiration age in seconds. So, the user logs in once and can stay logged in for hours (even days). Read More

  • Posted on Листопад 03, 2010

django excel response

A subclass of HttpResponse which will transform a QuerySet, or sequence of sequences, into either an Excel spreadsheet or CSV file formatted for Excel, depending on the amount of data. All of this is done in-memory and on-the-fly, with no disk writes, thanks to the StringIO library. Read More

  • Posted on Жовтень 01, 2010

MemcachedKeyLengthError: Key length is > 250

Fix for python-memcached MemcachedKeyLengthError Read More

  • Posted on Серпень 11, 2010

Django mongoengine cache backend

I decided to create mongoengine cache backed based on django-mongodb-cache Read More

  • Posted on Червень 01, 2010

Ordering related objects in Django

Django models have a meta option order_with_respect_to that allows you to order objects within the scope of a related ForeignKey object. Read More


hosting hostbe.net