-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
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
issue while trying to use with_cte on EmptyResultSet #84
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Django has a built-in check when the
rhs
of thequery
should return an emptyqueryset
. It raises anEmptyResultSet
and returns an empty list for the result. When you combine anEmptyResultSet
querywith_cte
unfortunately,django-cte
does not recognize it, and throws an error instead of returning an empty list.for a quick fix, you can overwrite the
__iter__
method of theCTEQuerySet
, but this is not a proper solution.The text was updated successfully, but these errors were encountered: