Guys help me figure it out.
I use an example from the documentation
https://docs.djangoproject.com/en/1.11/ref/models/expressions/#limiting-a-subquery-to-a-single-column
>>> from datetime import timedelta
>>> from django.utils import timezone
>>> one_day_ago = timezone.now() - timedelta(days=1)
>>> posts = Post.objects.filter(published_at__gte=one_day_ago)
>>> Comment.objects.filter(post__in=Subquery(posts.values('pk')))
But in my case 'pk' is `UUIDField()`
When sql is compiled, `unification_cast_sql()` is called
https://github.com/django/django/blob/stable/1.11.x/django/db/models/expressions.py#L980
The result is the following
ProgrammingError:
SELECT ... FROM table WHERE id in (CAST(SELECT id FROM table2) AS uuid);
Is this a bug or am I doing something wrong???
Thank you.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/687d6bb2-c61d-43ee-91b3-e25c22216188%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.