Skip to content

Instantly share code, notes, and snippets.

View justquick's full-sized avatar
⚙️
Contemplating the Infinite

Justin Quick justquick

⚙️
Contemplating the Infinite
View GitHub Profile
import haystack
from django.core.management import call_command
from django.test.utils import override_settings
TEST_INDEX = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',
@justquick
justquick / GFKManager.py
Created September 12, 2011 05:12 — forked from dexterbt1/GFKManager.py
django generic foreignkey manager
from django.db.models.query import QuerySet
from django.db.models import Manager
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
class GFKManager(Manager):
"""
A manager that returns a GFKQuerySet instead of a regular QuerySet.
"""
<html>
<head>
<script type="text/javascript">;
function mainLoop(){
ctx.clearRect(0,0,500,410);
playerPaddle.shape()
enemyPaddle.shape()
ball1.drawBall()
import importlib, os
APP_DIRS = (os.path.abspath(os.path.join(PROJECT_ROOT, 'test')),)
sys.path.extend(APP_DIRS)
BASE_URL_CONFS = []
for app_dir in APP_DIRS:
for app in os.listdir(app_dir):
if not app.startswith('.') and app not in INSTALLED_APPS:
try:
app_settings = importlib.import_module('%s.settings' % app)
if getattr(app_settings, 'APP_NAME', '') != '':