kopia lustrzana https://github.com/wagtail/wagtail
Eliminate remaining field.rel deprecation warnings from tests
rodzic
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
|
# if the relation is between obj and an object that has a page as a
|
||||||
# property, return the page
|
# property, return the page
|
||||||
for f in related_model._meta.fields:
|
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(
|
pages |= Page.objects.filter(
|
||||||
id__in=related_model._base_manager.filter(
|
id__in=related_model._base_manager.filter(
|
||||||
**{
|
**{
|
||||||
|
|
|
@ -1050,7 +1050,7 @@ class Page(six.with_metaclass(PageBase, AbstractPage, index.Indexed, Clusterable
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Ignore parent links (page_ptr)
|
# 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
|
continue
|
||||||
|
|
||||||
specific_dict[field.name] = getattr(specific_self, field.name)
|
specific_dict[field.name] = getattr(specific_self, field.name)
|
||||||
|
|
|
@ -20,7 +20,7 @@ class BaseSnippetChooserPanel(BaseChooserPanel):
|
||||||
@classmethod
|
@classmethod
|
||||||
def target_model(cls):
|
def target_model(cls):
|
||||||
if cls._target_model is None:
|
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
|
return cls._target_model
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue