mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-29 09:33:54 +01:00
Eliminate remaining field.rel deprecation warnings from tests
This commit is contained in:
parent
e5ecc6318b
commit
37c9913a35
@ -76,7 +76,7 @@ def get_object_usage(obj):
|
||||
# if the relation is between obj and an object that has a page as a
|
||||
# property, return the page
|
||||
for f in related_model._meta.fields:
|
||||
if isinstance(f, ParentalKey) and issubclass(f.rel.to, Page):
|
||||
if isinstance(f, ParentalKey) and issubclass(f.remote_field.model, Page):
|
||||
pages |= Page.objects.filter(
|
||||
id__in=related_model._base_manager.filter(
|
||||
**{
|
||||
|
@ -1050,7 +1050,7 @@ class Page(six.with_metaclass(PageBase, AbstractPage, index.Indexed, Clusterable
|
||||
continue
|
||||
|
||||
# Ignore parent links (page_ptr)
|
||||
if isinstance(field, models.OneToOneField) and field.rel.parent_link:
|
||||
if isinstance(field, models.OneToOneField) and field.remote_field.parent_link:
|
||||
continue
|
||||
|
||||
specific_dict[field.name] = getattr(specific_self, field.name)
|
||||
|
@ -20,7 +20,7 @@ class BaseSnippetChooserPanel(BaseChooserPanel):
|
||||
@classmethod
|
||||
def target_model(cls):
|
||||
if cls._target_model is None:
|
||||
cls._target_model = cls.model._meta.get_field(cls.field_name).rel.model
|
||||
cls._target_model = cls.model._meta.get_field(cls.field_name).remote_field.model
|
||||
|
||||
return cls._target_model
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user