mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-12 17:23:15 +00:00
Use _meta.get_fields() over deprecated _meta.get_all_related_objects()
This commit is contained in:
parent
90bcabd9cd
commit
904441de37
1 changed files with 2 additions and 4 deletions
|
|
@ -20,10 +20,8 @@ def get_object_usage(obj):
|
|||
pages = Page.objects.none()
|
||||
|
||||
# get all the relation objects for obj
|
||||
relations = type(obj)._meta.get_all_related_objects(
|
||||
include_hidden=True,
|
||||
include_proxy_eq=True
|
||||
)
|
||||
relations = [f for f in type(obj)._meta.get_fields(include_hidden=True)
|
||||
if (f.one_to_many or f.one_to_one) and f.auto_created]
|
||||
for relation in relations:
|
||||
related_model = relation.related_model
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue