Fixes PostgreSQL tests.

This commit is contained in:
Bertrand Bordage 2017-11-24 05:09:39 +01:00
parent d187bf4c75
commit b3bf2415d2
3 changed files with 5 additions and 2 deletions

View file

@ -209,7 +209,8 @@ class PostgresSearchQueryCompiler(BaseSearchQueryCompiler):
else:
sub_field_name = None
for field in fields:
if field.field_name == field_name:
if isinstance(field, SearchField) \
and field.field_name == field_name:
# Note: Searching on a specific related field using
# `.search(fields=…)` is not yet supported by Wagtail.
# This method anticipates by already implementing it.

View file

@ -14,6 +14,8 @@ from .utils import get_descendants_content_types_pks
class TextIDGenericRelation(GenericRelation):
auto_created = True
def get_content_type_lookup(self, alias, remote_alias):
field = self.remote_field.model._meta.get_field(
self.content_type_field_name)

View file

@ -1035,7 +1035,7 @@ class Page(six.with_metaclass(PageBase, AbstractPage, index.Indexed, Clusterable
def copy(self, recursive=False, to=None, update_attrs=None, copy_revisions=True, keep_live=True, user=None):
# Fill dict with self.specific values
specific_self = self.specific
default_exclude_fields = ['id', 'path', 'depth', 'numchild', 'url_path', 'path']
default_exclude_fields = ['id', 'path', 'depth', 'numchild', 'url_path', 'path', 'index_entries']
exclude_fields = default_exclude_fields + specific_self.exclude_fields_in_copy
specific_dict = {}