We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've been using several polymorphic model filters to get only the instances of specific types. For example:
class MyModelFilter(FilterSet): def polymorphic_type_filter(self, queryset: PolymorphicQuerySet, name: str, type_names: Iterable[str]) -> QuerySet: type_models = [] for model_class in MyModelPolymorphicSerializer.model_serializer_mapping.keys(): if model_class.__name__ in type_names: type_models.append(model_class) return queryset.instance_of(*type_models) resourcetype__in = CharInFilter(method=polymorphic_type_filter.__name__, field_name="resourcetype")
Django 3 no longer allows filtering a union query set, so after upgrading this filter results in the following error:
union
django.db.utils.NotSupportedError: Calling QuerySet.filter() after union() is not supported.
I'm looking for a workaround for this, but I'm not sure how easy this is to do. Is there a known fix?
The weird thing is, this ticket says this never used to work, but I've got tests which say otherwise.
The text was updated successfully, but these errors were encountered:
Looks like this might've been a red herring. Sorry for the noise.
Sorry, something went wrong.
No branches or pull requests
I've been using several polymorphic model filters to get only the instances of specific types. For example:
Django 3 no longer allows filtering a
union
query set, so after upgrading this filter results in the following error:I'm looking for a workaround for this, but I'm not sure how easy this is to do. Is there a known fix?
The weird thing is, this ticket says this never used to work, but I've got tests which say otherwise.
The text was updated successfully, but these errors were encountered: