• 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 Листопад 06, 2010

WebSockets in Python

Since the dawn of AJAX, web developers have longed for persistent server-side connections. For a while Comet was hailed as the bastion of “server push”, but deep down we knew it was just a hack. Now finally, years later, we have an API and a protocol being standardized for socket connections between the browser and the server – aptly named, WebSockets. Read More

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

Goo.gl URL shortener

How to make shorten url using goo.gl Read More

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

MemcachedKeyLengthError: Key length is > 250

Fix for python-memcached MemcachedKeyLengthError Read More

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

Python and lists:flatten. Such as in Erlang

Python does not has function to transform nested lists in a flatten lists, such as lists:flatten in Erlang. This is my example. Read More


hosting hostbe.net