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
| CREATE DATABASE bot2_local | |
| WITH OWNER = opquast | |
| ENCODING = 'UTF8' | |
| TABLESPACE = temesis_dev | |
| LC_COLLATE = 'fr_FR.UTF-8' | |
| LC_CTYPE = 'fr_FR.UTF-8' | |
| CONNECTION LIMIT = -1; |
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
| apt-get intall libxapian-dev | |
| 184 apt-get install libxapian-dev | |
| 185 apt-get install apt-xapian-index | |
| 186 ./configure --prefix=$VENV --with-python && make && make install | |
| 187 apt-cache search xapian | |
| 188 apt-cache search libtool | |
| 189 apt-get install libtool | |
| 190 ./configure --prefix=$VENV --with-python && make && make install | |
| 191 apt-get install libltdl-dev | |
| 192 ./configure --prefix=$VENV --with-python && make && make install |
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
| pip install django-haystack==2.3.1 | |
| pip install git+https://github.com/notanumber/xapian-haystack.git | |
| # Check and correct /lib/python2.7/site-packages/xapian_backend.py L64 for python 2.6 | |
| apt-get install uuid-dev | |
| apt-get install zlib1g-dev | |
| apt-get install g++ | |
| export VENV=$VIRTUAL_ENV |
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 split_word(word, length=230): | |
| return (word[n:n+length] for n in range(0, len(word), length)) | |
| def prepare_YOUR_FIELD(self, obj): | |
| return u' '.join(item for word in obj.YOUR_FIELD.split() for item in split_word(word)) |
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 generate_criteria_list(self): | |
| thema = ChecklistField.objects.filter( | |
| checklist=self, | |
| type=COLUMN_TYPES['PRIMARY']).values_list('pk', flat=True)[0] | |
| level = ChecklistField.objects.filter( | |
| checklist=self, | |
| type=COLUMN_TYPES['PRIORITY']).values_list('pk', flat=True)[0] | |
| cfv = CriterionFieldValue.objects.prefetch_related('fieldvalues').select_related('criterion').filter( | |
| Q(field=level) | Q(field=thema), |
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
| #!/usr/bin/env python | |
| #http://stackoverflow.com/questions/7669938/get-the-olson-tz-name-for-the-local-timezone | |
| from hashlib import sha224 | |
| import os | |
| from os import listdir | |
| from os.path import join, isfile, isdir | |
| infoDir = '/usr/share/zoneinfo/' |
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 datetime import datetime | |
| from django.db.models import Manager | |
| from django.db.models.query import QuerySet | |
| class TodoMixin(object): | |
| def is_done(self): | |
| return self.filter(done=is_true)) | |
| #ecrire ici vos nouvelles méthodes | |
| class TodoQuerySet(QuerySet, PostMixin): |
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
| If you want to commit on top of the current HEAD with the exact state at a different commit, undoing all the intermediate commits, then you can use reset to create the correct state of the index to make the commit. | |
| # reset the index to the desired tree | |
| git reset 56e05fced | |
| # move the branch pointer back to the previous HEAD | |
| git reset --soft HEAD@{1} |
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.utils.functional import curry | |
| from django.forms.models import modelformset_factory | |
| ManagerFormset = modelformset_factory(User, ManagerForm, extra=0) | |
| ManagerFormset.form = staticmethod(curry(ManagerForm, selected=selected, company=company)) | |
| form = ManagerFormset(queryset=coworkers) |
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
| if check_po /home/sam/opquast/pdn/locale/fr/LC_MESSAGES/django.po | grep 'FUZZY'; then | |
| echo "\033[44m----------------------------------------------------\033[0m" | |
| echo "\033[31m FUZZY présent dans locale/fr/LC_MESSAGES/django.po\033[0m" | |
| exit 1 | |
| else | |
| echo -n "\033[32m" | |
| check_po /home/sam/opquast/pdn/locale/fr/LC_MESSAGES/django.po | |
| echo -n "\033[0m" | |
| fi |