mirror of
https://github.com/Hopiu/django-watson.git
synced 2026-03-16 22:00:22 +00:00
Merge pull request #150 from SimonGreenhill/django-1.10
Fixing Django 1.10 Deprecation Warnings.
This commit is contained in:
commit
c611d6d905
4 changed files with 14 additions and 13 deletions
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from watson.search import get_backend
|
||||
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
class Command(BaseCommand):
|
||||
|
||||
help = "Creates the database indices needed by django-watson."
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
def handle(self, *args, **options):
|
||||
"""Runs the management command."""
|
||||
verbosity = int(options.get("verbosity", 1))
|
||||
backend = get_backend()
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
"""Exposed the watson.get_registered_models() function as management command for debugging purpose. """
|
||||
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.core.management.base import BaseCommand
|
||||
from watson import search as watson
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
class Command(BaseCommand):
|
||||
|
||||
help = "List all registed models by django-watson."
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
def handle(self, *args, **options):
|
||||
"""Runs the management command."""
|
||||
self.stdout.write("The following models are registed for the django-watson search engine:\n")
|
||||
for mdl in watson.get_registered_models():
|
||||
|
|
|
|||
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from watson.search import get_backend
|
||||
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
class Command(BaseCommand):
|
||||
|
||||
help = "Destroys the database indices needed by django-watson."
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
def handle(self, *args, **options):
|
||||
"""Runs the management command."""
|
||||
verbosity = int(options.get("verbosity", 1))
|
||||
backend = get_backend()
|
||||
|
|
|
|||
|
|
@ -4,11 +4,12 @@ from __future__ import unicode_literals
|
|||
|
||||
from django.conf.urls import url, patterns
|
||||
|
||||
from watson.views import search, search_json
|
||||
|
||||
urlpatterns = patterns("watson.views",
|
||||
urlpatterns = [
|
||||
|
||||
url("^$", "search", name="search"),
|
||||
url("^$", search, name="search"),
|
||||
|
||||
url("^json/$", "search_json", name="search_json"),
|
||||
url("^json/$", search_json, name="search_json"),
|
||||
|
||||
)
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue