Replies: 1 comment 1 reply
-
I've posted an answer on SO, copying it here for visibility: If you're using PostgreSQL, this is caused by a 12-year-old Django issue https://code.djangoproject.com/ticket/16055 that will be fixed in Django 5.0 (yet to be released at the time of writing). A possible workaround: from django.contrib.contenttypes.models import ContentType
from wagtail.models import Page, Revision
base_page_ct = ContentType.objects.get_for_model(Page)
not_live_ids = Page.objects.not_live().values_list('id', flat=True)
Revision.page_revisions.filter(base_content_type=base_page_ct, object_id__in=not_live_ids)
I assume you mean "query for revisions"? Using a similar trick as above, you can filter the page first, use Since QuerySets are lazy, the first query to get the page IDs won't be evaluated directly and instead will be used as a subquery to revision query. |
Beta Was this translation helpful? Give feedback.
-
I ran into a problem updating from 3.0.3 to 4.0 (I am headed to 5.0, but I am taking my upgrades step-wise.)
I asked about it on StackOverflow, but it's had no attention so far.
Even if this is intended behavior, it needs a better error. A sql exception from the db is a little rough.
Beta Was this translation helpful? Give feedback.
All reactions