Skip to content

Commit

Permalink
Merge pull request #185 from ogiogi93/fix/readme
Browse files Browse the repository at this point in the history
Import Document not DocType
  • Loading branch information
safwanrahman authored Jun 15, 2019
2 parents 43756c0 + cb9fd2f commit 5c327ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion django_elasticsearch_dsl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.utils.module_loading import autodiscover_modules

from .documents import DocType # noqa
from .documents import Document # noqa
from .indices import Index # noqa
from .fields import * # noqa

Expand Down
12 changes: 6 additions & 6 deletions tests/documents.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from elasticsearch_dsl import analyzer
from django_elasticsearch_dsl import DocType, Index, fields
from django_elasticsearch_dsl import Document, Index, fields
from django_elasticsearch_dsl.registries import registry

from .models import Ad, Category, Car, Manufacturer
Expand All @@ -19,7 +19,7 @@


@registry.register_document
class CarDocument(DocType):
class CarDocument(Document):
# test can override __init__
def __init__(self, *args, **kwargs):
super(CarDocument, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -67,7 +67,7 @@ def get_instances_from_related(self, related_instance):


@registry.register_document
class ManufacturerDocument(DocType):
class ManufacturerDocument(Document):
country = fields.StringField()

class Django:
Expand All @@ -85,7 +85,7 @@ class Index:


@registry.register_document
class CarWithPrepareDocument(DocType):
class CarWithPrepareDocument(Document):
manufacturer = fields.ObjectField(properties={
'name': fields.StringField(),
'country': fields.StringField(),
Expand Down Expand Up @@ -128,7 +128,7 @@ def get_instances_from_related(self, related_instance):


@registry.register_document
class AdDocument(DocType):
class AdDocument(Document):
description = fields.TextField(
analyzer=html_strip,
fields={'raw': fields.KeywordField()}
Expand All @@ -149,7 +149,7 @@ class Index:


@registry.register_document
class PaginatedAdDocument(DocType):
class PaginatedAdDocument(Document):

class Django:
model = Ad
Expand Down

0 comments on commit 5c327ac

Please sign in to comment.