This prevents `create_extra_permissions` from querying or creating
ContentType or Permission objects if the models cannot be found.
When using multiple databases which do not have the auth_permission
table `create_extra_permissions` will cause migrate to fail.
This is similar to https://code.djangoproject.com/ticket/24075.
Thanks to @crccheck for additional bug reporting.
The `check` method in BaseSearchQueryCompiler rejects these, so this doesn't make a difference to real-world queries. However, the check is only performed after compilation is complete, so we still need to guard against this with `searchable_fields.get`.
However, our tests _do_ blithely use non-existent fields, so fix those too...
At indexing time, any SearchFields with a boost value assigned are copied to an index field named "_all_text_boost_{value}". Then, when querying, we compile a list of all such index fields and query on those fields, with the relevant boost applied to each one.
Previously, "all such index fields" was obtained by looking at distinct boost values across all indexed models. However, we only really need to consider models that can actually appear in the results - i.e. are subclasses of self.queryset.model. If a boost value does not appear among this set of models, then these models will never contribute anything to that "_all_text_boost_{value}" index field, and so it's pointless to query it.
Otherwise, the list of values will be stringified and then URL encoded, resulting in something like locale=%5B%27en%27%5D
From parse_qs docs: Use the urllib.parse.urlencode() function (with the doseq parameter set to True) to convert such dictionaries into query strings.
- Move preview image to above the 'fold' so it's clearer to users what this page is for
- Avoid the JS driven (non-responsive) alert that shows if the image is too large and instead opt for a simpler CSS approach, allowing the image to overflow with a scrolling container
- Add w-prefixed classes for elements
- Ensure URL has an accessible label
- Relates to #3683