mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-11 16:53:10 +00:00
Added get_indexed_objects method to Indexed class
This gives developers control over the QuerySet used when the model is added to the indexed
This commit is contained in:
parent
b78b648682
commit
9e1bd2d601
2 changed files with 5 additions and 1 deletions
|
|
@ -118,6 +118,10 @@ class Indexed(object):
|
|||
def get_filterable_search_fields(cls):
|
||||
return filter(lambda field: isinstance(field, FilterField), cls.get_search_fields())
|
||||
|
||||
@classmethod
|
||||
def get_indexed_objects(cls):
|
||||
return cls.objects.all()
|
||||
|
||||
indexed_fields = ()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class Command(BaseCommand):
|
|||
toplevel_content_type = model.indexed_get_toplevel_content_type()
|
||||
|
||||
# Loop through objects
|
||||
for obj in model.objects.all():
|
||||
for obj in model.get_indexed_objects():
|
||||
# Get key for this object
|
||||
key = toplevel_content_type + ':' + str(obj.pk)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue