Skip to content

Instantly share code, notes, and snippets.

@timbroder
timbroder / gist:4547825
Last active December 11, 2015 04:48
adding facet.mincount to django-haystack
#the backend
class MySolrBackend(SolrSearchBackend):
def build_search_kwargs(self, *args, **kwargs):
facet_mincount = kwargs.pop('facet_mincount', None)
search_kwargs = super(AiSolrBackend, self).build_search_kwargs(*args, **kwargs)
if facet_mincount is not None:
search_kwargs['facet'] = 'on'
search_kwargs['facet.mincount'] = facet_mincount
theme loaded
app ready
pre session restore time: 0.675485
using gamma: 2 (err: 6.9282)
wrote startup cache, added files: 2 orphaned files: 0 total files: 101 cache hits: 99
startup time: 0.976856 (package setup was not run)
loaded 837 snippets
Package Control: Installing 16 missing packages
Package Control: Download Debug
URL: https://sublime.wbond.net/repositories.json
March 24, 2005
Blossom Street
"And I could hear his footsteps creeping past my window.
It was before dawn.
It was so dark, I couldn't read my watch.
But his footsteps awoke me just the same.
And I crept downstairs to see old Adam on his knees past the outhouse.
He was digging.
I crouched behind the outhouse, watching his every move.
keys = ['job_2254-t02240.pdf',
'job_2254-t02240.pdf',
'job_2254-t02244.pdf',
'job_2254-t02241.pdf',
'job_2254-t02242.pdf',
'job_2254-t02293.pdf',
'job_2254-t02243.pdf',
'job_2254-t0220.pdf',
'job_2254-t0221.pdf',
'job_2254-t0222.pdf',
function reloadStylesheets() {
var queryString = '?reload=' + new Date().getTime();
$('link[rel="stylesheet"]').each(function () {
this.href = this.href.replace(/\?.*|$/, queryString);
});
}
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'app.views.home', name='home'),
# url(r'^app/', include('app.foo.urls')),
# Django settings for app project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
AUTHENTICATION_BACKENDS = (
'social_auth.backends.google.GoogleOAuth2Backend',
# 'social_auth.backends.google.GoogleBackend',
# 'django.contrib.auth.backends.ModelBackend',
)
SOCIAL_AUTH_ENABLED_BACKENDS = ('google-oauth2')
GOOGLE_OAUTH_EXTRA_SCOPE = ['http://www.google.com/m8/feeds', 'http://www.google.com/reader/api/', 'http://www.google.com/reader/atom/', 'https://www.googleapis.com/auth/plus.me']
SOCIAL_AUTH_DEFAULT_USERNAME = 'new_social_auth_user'
SOCIAL_AUTH_UUID_LENGTH = 16
javascript:function%20tab(a){"use%20strict";var%20b=document.getElementById(a).getElementsByTagName("tr"),c=window.confirm("Do%20you%20want%20to%20open%20"+(b.length-1)+"%20Jiras?");if(c)for(var%20d=1;d<b.length;d++){var%20e=b[d].getElementsByClassName("summary")[0].getElementsByTagName("a")[0];window.open(e.href)}}tab("issuetable")
(9:18:22 AM) Tim: an inflatable sex sheep may be delivered to the condo. do not be alarmed. its for Sean
(9:18:31 AM) Tim: because a non stripper bachelor party needs an inflatable sheep
(9:18:33 AM) Tim: and its $10
(9:33:47 AM) Laura: haha, that's awesome