Skip to content

Instantly share code, notes, and snippets.

View ikks's full-sized avatar

Igor Támara ikks

View GitHub Profile
@ikks
ikks / restitutionrequest_text.txt
Created February 10, 2012 23:52
sample template for haystack search
{{ object.assignednumber }}
{{ object.holderrightenterprise.nit }}
{{ object.territory }}
{{ object.people }}
@ikks
ikks / gist:1793995
Created February 10, 2012 23:31
xapian backend in virtualenv
export MYENV=~/.virtualenvs/tr
export LOCALPYTHON=/usr/lib/python2.7
ln -s $LOCALPYTHON/dist-packages/xapian/__init__.py $MYENV/lib/python2.7/site-packages/xapian.py
ln -s $LOCALPYTHON/dist-packages/xapian/_xapian.so $MYENV/lib/python2.7/site-packages/
if [ ! -f $MYENV/lib/python2.7/site-packages/haystack/backends/xapian_backend.py ]
then
ln -s $MYENV/lib/python2.7/site-packages/xapian_backend.py $MYENV/lib/python2.7/site-packages/haystack/backends/
fi
@ikks
ikks / search_indexes.py
Created February 10, 2012 23:06
Haystack search indexes sample
from haystack.indexes import RealTimeSearchIndex
from haystack.indexes import CharField
from haystack.indexes import RealTimeSearchIndex
from haystack.indexes import CharField
from haystack.indexes import MultiValueField
from haystack import site
from apps.informationgathering.models import RR