mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-11 18:40:59 +00:00
Django 1.8 support for API
This commit is contained in:
parent
ee2f5530cf
commit
3efbb152ca
1 changed files with 2 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ from wagtail.wagtailimages.models import get_image_model
|
|||
from wagtail.wagtaildocs.models import Document
|
||||
from wagtail.wagtailcore.utils import resolve_model_string
|
||||
from wagtail.wagtailsearch.backends import get_search_backend
|
||||
from wagtail.utils.compat import get_related_model
|
||||
|
||||
from .utils import BadRequestError
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ def get_api_data(obj, fields):
|
|||
child_relations = {}
|
||||
if isinstance(obj, Page):
|
||||
child_relations = {
|
||||
child_relation.field.rel.related_name: child_relation.model
|
||||
child_relation.field.rel.related_name: get_related_model(child_relation)
|
||||
for child_relation in get_all_child_relations(type(obj))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue