Skip to content

Commit

Permalink
Fix index fields to be a list, Django 2.0 demands it
Browse files Browse the repository at this point in the history
  • Loading branch information
fjsj committed Feb 12, 2019
1 parent 1c1f6c8 commit 326d21e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ Quickstart
class Meta:
indexes = [
ZomboDBIndex(fields=(
ZomboDBIndex(fields=[
'name',
)),
]),
]
3. Make the migrations:
Expand Down
8 changes: 4 additions & 4 deletions docs/integrating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ To integrate it with Elasticsearch, we need to add a :py:class:`~django_zombodb.
class Meta:
indexes = [
ZomboDBIndex(fields=(
ZomboDBIndex(fields=[
'name',
'street',
)),
]),
]
Now that model will support Elasticsearch queries for both ``name`` and ``street`` fields. But to perform those searches, we need it to use the custom queryset :py:class:`~django_zombodb.querysets.SearchQuerySet`:
Expand All @@ -80,10 +80,10 @@ Now that model will support Elasticsearch queries for both ``name`` and ``street
class Meta:
indexes = [
ZomboDBIndex(fields=(
ZomboDBIndex(fields=[
'name',
'street',
)),
]),
]
.. note::
Expand Down
4 changes: 2 additions & 2 deletions example/restaurants/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ class Restaurant(models.Model):

class Meta:
indexes = [
ZomboDBIndex(fields=(
ZomboDBIndex(fields=[
'name',
'street',
'zip_code',
'city',
'state',
'phone',
'categories',
)),
]),
]

def __str__(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/restaurants/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Meta:
indexes = [
ZomboDBIndex(
url='http://localhost:9200/',
fields=(
fields=[
'name',
'street',
'zip_code',
Expand All @@ -36,7 +36,7 @@ class Meta:
'email',
'website',
'categories',
)
]
),
]

Expand Down

0 comments on commit 326d21e

Please sign in to comment.