Skip to content

Commit 9afc038

Browse files
laymonagethibaudcolas
authored andcommitted
Expose Image.collection in the API
1 parent 3295796 commit 9afc038

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bakerydemo/base/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
register_setting,
2222
)
2323
from wagtail.fields import RichTextField, StreamField
24+
from wagtail.images.models import Image
2425
from wagtail.models import (
2526
Collection,
2627
DraftStateMixin,
@@ -37,6 +38,9 @@
3738

3839
from .blocks import BaseStreamBlock
3940

41+
# Allow filtering by collection
42+
Image.api_fields = [APIField("collection")]
43+
4044

4145
class Person(
4246
WorkflowMixin,

0 commit comments

Comments
 (0)