Eliminate remaining field.rel deprecation warnings from tests

pull/3999/head
Matt Westcott 2017-11-04 08:16:46 +00:00 zatwierdzone przez Karl Hobley
rodzic e5ecc6318b
commit 37c9913a35
3 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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(
**{

Wyświetl plik

@ -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)

Wyświetl plik

@ -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