Skip to content

Commit

Permalink
Upgrade dependencies to latest versions
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanw committed Mar 1, 2013
1 parent 6e367d0 commit aca0035
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 70 deletions.
4 changes: 4 additions & 0 deletions froide/custom_settings.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ from .settings import * # noqa
# }
# }

# HAYSTACK_SIGNAL_PROCESSOR = 'celery_haystack.signals.CelerySignalProcessor'

# CELERY_HAYSTACK_MODELS = ('foirequest.FoiRequest', 'publicbody.PublicBody')


########## Froide settings ########

Expand Down
6 changes: 2 additions & 4 deletions froide/foirequest/search_indexes.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from haystack import indexes

from celery_haystack.indexes import CelerySearchIndex

from .models import FoiRequest


class FoiRequestIndex(CelerySearchIndex, indexes.Indexable):
class FoiRequestIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
description = indexes.CharField(model_attr='description')
Expand All @@ -20,7 +18,7 @@ class FoiRequestIndex(CelerySearchIndex, indexes.Indexable):
def get_model(self):
return FoiRequest

def index_queryset(self):
def index_queryset(self, **kwargs):
"""Used when the entire index for model is updated."""
return self.get_model().published.get_for_search_index()

Expand Down
11 changes: 5 additions & 6 deletions froide/foirequest/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from haystack import connections
from haystack.utils import get_identifier

from celery_haystack.utils import get_update_task

from .models import FoiRequest, FoiMessage, FoiAttachment, FoiEvent


def trigger_index_update(klass, instance_pk):
fake_instance = klass()
fake_instance.pk = instance_pk
uni = connections['default'].get_unified_index()
index = uni.get_index(klass)
index.enqueue_save(fake_instance)
task = get_update_task()
task.delay('update', get_identifier(klass(id=instance_pk)))


@receiver(FoiRequest.became_overdue,
Expand Down
6 changes: 2 additions & 4 deletions froide/publicbody/search_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

from haystack import indexes

from celery_haystack.indexes import CelerySearchIndex

from .models import PublicBody

PUBLIC_BODY_BOOSTS = getattr(settings, "FROIDE_PUBLIC_BODY_BOOSTS", {})


class PublicBodyIndex(CelerySearchIndex, indexes.Indexable):
class PublicBodyIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
name = indexes.CharField(model_attr='name', boost=1.5)
jurisdiction = indexes.CharField(model_attr='jurisdiction__name', default='')
Expand All @@ -21,7 +19,7 @@ class PublicBodyIndex(CelerySearchIndex, indexes.Indexable):
def get_model(self):
return PublicBody

def index_queryset(self):
def index_queryset(self, **kwargs):
"""Used when the entire index for model is updated."""
return self.get_model().objects.get_for_search_index()

Expand Down
2 changes: 2 additions & 0 deletions froide/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@
'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
}
}
HAYSTACK_SIGNAL_PROCESSOR = 'celery_haystack.signals.CelerySignalProcessor'

CELERY_HAYSTACK_MODELS = ('foirequest.FoiRequest', 'publicbody.PublicBody')

########## Froide settings ########

Expand Down
9 changes: 6 additions & 3 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
-r requirements.txt
django-discover-runner==0.2.2
pyelasticsearch==0.2
selenium==2.29.0
django-discover-runner==0.3
pyelasticsearch==0.3
selenium==2.30.0
pep8==1.4.4
factory-boy==1.1.4
coverage==3.6
66 changes: 13 additions & 53 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,67 +1,27 @@
BeautifulSoup==3.2.1
Django==1.5
Fabric==1.2.0
Jinja2==2.6
Markdown==2.2.0
Pygments==1.4
Markdown==2.2.1
Pygments==1.6
South==0.7.6
Sphinx==1.1
amqplib==1.0.2
anyjson==0.3.3
billiard==2.7.3.12
celery==3.0.8
-e git://github.com/stefanw/celery-haystack.git@3339ceec5ba14d37ef4247f60a454d935c4c7aa5#egg=celery_haystack-dev
coverage==3.5.2
cssutils==0.9.10b1
django-appconf==0.5
django-celery==3.0.6
Sphinx==1.1.3
celery==3.0.15
-e git://github.com/stefanw/celery-haystack.git@latest-deploy#egg=celery_haystack
django-celery==3.0.11
django-celery-email==1.0.3
django-celery-transactions==0.1.2
django-crispy-forms==1.1.4
django-debug-toolbar==0.9.4
-e git://github.com/stefanw/django-haystack.git@46eeb7c39b2dceac714c7007847bd7013fb2734e#egg=django_haystack-dev
django-indexer==0.3.0
django-kombu==0.9.4
-e git://github.com/stefanw/django-haystack.git@update-index-language#egg=django_haystack
django-pagination==1.0.7
django-paging==0.2.4
django-picklefield==0.2.1
django-secure==0.1.2
django-sentry==1.13.5
django-social-auth==0.7.5
django-taggit==0.9.3
django-templatetag-sugar==0.1
django-voting==0.1
docutils==0.8.1
eventlet==0.9.16
-e git://github.com/dnerdy/factory_boy.git@c3069876b43cc30b24df44ef1b5ada1a1dc0358b#egg=factory_boy-dev
feedparser==5.1.2
greenlet==0.3.4
gunicorn==0.14.6
httpagentparser==1.1.3
httplib2==0.7.5
kombu==2.4.5
lockfile==0.9.1
logan==0.3.1
lxml==2.3.4
oauth2==1.5.211
paramiko==1.7.7.1
pep8==1.3.3
psycopg2==2.4.5
pycrypto==2.3
pynliner==0.4.0
pyparsing==1.5.6
feedparser==5.1.3
lxml==2.3.5
psycopg2==2.4.6
pysolr==2.0.13
python-daemon==1.6
python-dateutil==1.5
python-openid==2.2.5
pytz==2012d
raven==2.0.5
requests==0.13.9
sentry==4.10.0
simplejson==2.6.1
wsgiref==0.1.2
pytz==2012j
requests==1.1.0
django-gravatar2==1.0.6
django-floppyforms==1.0
django-floppyforms==1.1
django-overextends==0.2.2
unicodecsv==0.9.0
python-magic==0.4.3
Expand Down

0 comments on commit aca0035

Please sign in to comment.