You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't understand why Board.objects.all().count() gets 6 instead of 1.
When you apply objects = SafeDeleteManager(), 1 is normally displayed.
The reason I did that is to call the function in a chainable manner.
Board.objects.is_public().for_user(user=user)
It's meant to be done this way, but it doesn't work.
Situations I've Experienced
If you do objects = BoardQuerySet.as_manager(), it works normally and 1 comes out. However, because select_related does not work, the number of queries increases from 10 to 20, so the speed decreases significantly.
objects = BoardManager.from_queryset(BoardQuerySet)()
When BoardManager.from_queryset(BoardQuerySet)() is used, deleted objects are not visible, but many queries occur because select_related is not applied.
Of course, the simplest solution would be to use Board.objects.filter(delted__isnull=False), but this is not an advantage of using the Manager. Please let me know how to solve it.
I don't understand why Board.objects.all().count() gets 6 instead of 1.
When you apply objects = SafeDeleteManager(), 1 is normally displayed.
The reason I did that is to call the function in a chainable manner.
Board.objects.is_public().for_user(user=user)
It's meant to be done this way, but it doesn't work.
Situations I've Experienced
If you do objects = BoardQuerySet.as_manager(), it works normally and 1 comes out. However, because select_related does not work, the number of queries increases from 10 to 20, so the speed decreases significantly.
objects = BoardManager.from_queryset(BoardQuerySet)()
When BoardManager.from_queryset(BoardQuerySet)() is used, deleted objects are not visible, but many queries occur because select_related is not applied.
Of course, the simplest solution would be to use Board.objects.filter(delted__isnull=False), but this is not an advantage of using the Manager. Please let me know how to solve it.
TMP Solution
The text was updated successfully, but these errors were encountered: