-
Notifications
You must be signed in to change notification settings - Fork 370
Prep for Django 5.0 #552
Copy link
Copy link
Closed
Description
Hi, here's a heads up on a future issue that I just stumbled upon. I have no idea about the full extent but do at least know of one change in Django 5.0 that will break sql-explorer.
The passing of unsaved model instances to related filters will be fully deprecated see https://github.com/django/django/pull/16432.
This breaks at least the following code in this package (views.utils) when using the Playground:
user = request.user
is_favorite = False
if user.is_authenticated:
is_favorite = QueryFavorite.objects.filter(user=user, query=query).exists()QueryFavorite.objects.filter(user=user) is ok, however, QueryFavorite.objects.filter(query=query) isn't and raises ValueError("Model instances passed to related filters must be saved.") because query isn't saved and therefore has no pk.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels