mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-30 11:10:43 +01:00
Allow indexing arrays of model instances in FilterField
This commit is contained in:
parent
a68597dadf
commit
f67f0e39c3
@ -263,6 +263,8 @@ class Elasticsearch2Mapping:
|
||||
value = list(value.values_list('pk', flat=True))
|
||||
elif isinstance(value, models.Model):
|
||||
value = value.pk
|
||||
elif isinstance(value, (list, tuple)):
|
||||
value = [item.pk if isinstance(item, models.Model) else item for item in value]
|
||||
|
||||
doc[self.get_field_column_name(field)] = value
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user