This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/kostplaneraren/recipe/search_indexes.py b/kostplaneraren/recipe/search_indexes.py | |
index 7f336e7..376c6eb 100644 | |
--- a/kostplaneraren/recipe/search_indexes.py | |
+++ b/kostplaneraren/recipe/search_indexes.py | |
@@ -17,6 +17,11 @@ class RecipeIndex(SearchIndex): | |
#pre rendered version | |
rendered = CharField(use_template=True, indexed=False) | |
+ # Sort by name | |
+ name_s = CharField() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubuntu@web:/var/sites/kostplaneraren/kostplaneraren$ python manage.py celeryd | |
/usr/local/lib/python2.7/dist-packages/celery/decorators.py:33: CDeprecationWarning: | |
The `celery.decorators` module and the magic keyword arguments | |
are pending deprecation and will be deprecated in 2.4, then removed | |
in 3.0. | |
`task.request` should be used instead of magic keyword arguments, | |
and `celery.task.task` used instead of `celery.decorators.task`. | |
See the 2.2 Changelog for more information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Indexing 14162 ingredients. | |
Indexing 1735 recipes. | |
real 1m45.115s | |
user 1m18.182s | |
sys 0m2.621s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from haystack.sites import site | |
from planner.models import SharedMealPlan | |
# Make sure the search index is registered | |
import planner.search_indexes | |
index = site.get_index(SharedMealPlan) | |
index.reindex() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import re | |
import requests | |
# Set USERNAME and PASSWORD to your Github credentials and REPO_URL to your github repo. | |
import settings | |
auth = (settings.USERNAME, settings.PASSWORD) | |
api_url = 'https://api.github.com/repos/%s/%%s' % (settings.REPO_URL, ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Git post checkout hook. | |
# Reminds you of South migration changes when switching branches. | |
# Can be useful when you are when you are testing out a branch from | |
# someone else that requires migrations. | |
# Put the file in .git/hooks/post-checkout | |
PREVIOUS_HEAD=$1 | |
NEW_HEAD=$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Python indent file | |
" Language: Python | |
" Maintainer: Gustaf Hansen <[email protected]> | |
" Original Author: David Bustos <[email protected]> | |
" Last Change: 2012-04-10 | |
" Only load this indent file when no other was loaded. | |
if exists("b:did_indent") | |
finish | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import string | |
def random_code(): | |
available_chars = string.uppercase + string.digits | |
return ''.join(random.choice(available_chars) for i in xrange(8)) | |
for i in xrange(10): | |
print "code %d: %s" % (i, random_code()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def wiki_access(f): | |
def wrap(request, *args, **kwargs): | |
wiki = _get_wiki_from_request(request, **kwargs) | |
if request.user.is_authenticated(): | |
try: | |
user_company = request.user.personnel.company | |
except ObjectDoesNotExist: | |
pass | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from models import ArticleImage | |
class ArticleImageForm(forms.ModelForm): | |
class Meta: | |
model = ArticleImage | |
fields = ('image', ) |
OlderNewer