Skip to content

Instantly share code, notes, and snippets.

View benzkji's full-sized avatar
🐙
eight times a thing

Ben Stähli benzkji

🐙
eight times a thing
  • bnzk GmbH
  • Biel/Bienne Switzerland
View GitHub Profile
@benzkji
benzkji / admin.py
Last active October 14, 2017 09:19 — forked from wullerot/admin.py
django-modeltranslation-language-tabs
from __future__ import unicode_literals
from django.conf import settings
class LanguageTabsMixin(object):
change_form_template = 'admin/modeltranslation/change_form.html'
def change_view(self, request, object_id, form_url='', extra_context=None):
context = extra_context or {}
@benzkji
benzkji / search_backends.py
Created February 25, 2016 09:14 — forked from gregplaysguitar/folding_whoosh_backend.py
Django-haystack Whoosh backend with character folding
# -*- coding: utf-8 -*-
"""
Whoosh backend for haystack that implements character folding, as per
http://packages.python.org/Whoosh/stemming.html#character-folding .
Tested with Haystack 2.4.0 and Whooch 2.7.0
To use, put this file on your path and add it to your haystack settings, eg.