Django application that provider the like and ilike lookups for the querysets
django-like is a Django application that adds other useful fields.
It is distributed under the terms of the GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl.html>
Something that you can to do with like sentence
MyModel.objects.filter(field_name__like='xx%YY%zz') MyModel.objects.filter(field_name__ilike='xx%yy%zz') User.objects.filter(username__like='a%in')
It is more quick and more readable that something like this:
This app provider two new lookups: like and ilike.
Now you can compare the time it takes to run the same query, many times, with like and with regex
python manage.py benchmark_like
These are a results executing the benchmark_like in my machine:
|Type & result \ Database||postgres||mysql||sqllite||oracle|
You can get the bleeding edge version of django-like by doing a clone of its repository
git clone git://github.com/goinnn/django-like.git
In the source tree, you will find a directory called example. It contains a readily setup project that uses django-like. You can run it as usual:
python manage.py syncdb --noinput python manage.py loaddata app_data python manage.py runserver