Re: Admin TypeError - Cannot call delete() after .distinct()
Just looked at that ticket and it seems probable that is what is happening.I'll be patient. Thanks for thatM--(Unsigned mail from my phone) Original message From: Jason Date: 2/7/21 22:30 (GMT+10:00) To: Django users Subject: Re: Admin TypeError - Cannot call delete() after .distinct() https://code.djangoproject.com/ticket/32682 might be the root cause, which was fixed end of April and part of the 3.2.1 release, doesn't seem like its been backported to 3.1On Friday, July 2, 2021 at 2:03:28 AM UTC-4 Mike Dewhirst wrote:Trying to delete a record in the Admin list view by checking the checkbox and selecting the delete action and clicking [Go] the following 500 error happened. It seems to be all within the Admin so I'm not sure how to proceed from here. Thanks for any hints Mike Traceback (most recent call last): File "D:\Users\mike\envs\xxai\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "D:\Users\mike\envs\xxai\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 616, in wrapper return self.admin_site.admin_view(view)(*args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", line 130, in _wrapped_view response = view_func(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\views\decorators\cache.py", line 44, in _wrapped_view_func response = view_func(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\sites.py", line 232, in inner return view(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", line 43, in _wrapper return bound_method(*args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", line 130, in _wrapped_view response = view_func(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 1739, in changelist_view response = self.response_action(request, queryset=cl.get_queryset(request)) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 1408, in response_action response = func(self, request, queryset) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\actions.py", line 45, in delete_selected modeladmin.delete_queryset(request, queryset) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 1109, in delete_queryset queryset.delete() File "D:\Users\mike\envs\xxai\lib\site-packages\django\db\models\query.py", line 728, in delete raise TypeError('Cannot call delete() after .distinct().') Exception Type: TypeError at /admin/chemical/chemical/ Exception Value: Cannot call delete() after .distinct(). -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature and be sure it came from me. Just ask and I'll send it to you. Your email software can handle signing. -- 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 django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/086bef60-4422-4021-949b-84e19e9768b2n%40googlegroups.com. -- 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 django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/60df20c4.1c69fb81.ed7bc.5675SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
Re: Admin TypeError - Cannot call delete() after .distinct()
Should have mentioned - I'm running 3.2.4M--(Unsigned mail from my phone) Original message From: Jason Date: 2/7/21 22:30 (GMT+10:00) To: Django users Subject: Re: Admin TypeError - Cannot call delete() after .distinct() https://code.djangoproject.com/ticket/32682 might be the root cause, which was fixed end of April and part of the 3.2.1 release, doesn't seem like its been backported to 3.1On Friday, July 2, 2021 at 2:03:28 AM UTC-4 Mike Dewhirst wrote:Trying to delete a record in the Admin list view by checking the checkbox and selecting the delete action and clicking [Go] the following 500 error happened. It seems to be all within the Admin so I'm not sure how to proceed from here. Thanks for any hints Mike Traceback (most recent call last): File "D:\Users\mike\envs\xxai\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "D:\Users\mike\envs\xxai\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 616, in wrapper return self.admin_site.admin_view(view)(*args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", line 130, in _wrapped_view response = view_func(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\views\decorators\cache.py", line 44, in _wrapped_view_func response = view_func(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\sites.py", line 232, in inner return view(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", line 43, in _wrapper return bound_method(*args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", line 130, in _wrapped_view response = view_func(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 1739, in changelist_view response = self.response_action(request, queryset=cl.get_queryset(request)) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 1408, in response_action response = func(self, request, queryset) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\actions.py", line 45, in delete_selected modeladmin.delete_queryset(request, queryset) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 1109, in delete_queryset queryset.delete() File "D:\Users\mike\envs\xxai\lib\site-packages\django\db\models\query.py", line 728, in delete raise TypeError('Cannot call delete() after .distinct().') Exception Type: TypeError at /admin/chemical/chemical/ Exception Value: Cannot call delete() after .distinct(). -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature and be sure it came from me. Just ask and I'll send it to you. Your email software can handle signing. -- 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 django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/086bef60-4422-4021-949b-84e19e9768b2n%40googlegroups.com. -- 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 django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/60df1f7f.1c69fb81.1daca.33a9SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
Re: Admin TypeError - Cannot call delete() after .distinct()
Hello Mike, i don't understand why you want make a delete from a distict... Then you delete random entrys. When you want do delete dupletes then this is a wrong method to delete dupletes... Regards Am Fr., 2. Juli 2021 um 08:03 Uhr schrieb Mike Dewhirst < mi...@dewhirst.com.au>: > Trying to delete a record in the Admin list view by checking the > checkbox and selecting the delete action and clicking [Go] the following > 500 error happened. > > It seems to be all within the Admin so I'm not sure how to proceed from > here. > > Thanks for any hints > > Mike > > Traceback (most recent call last): >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\core\handlers\exception.py", > > line 47, in inner > response = get_response(request) >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\core\handlers\base.py", > line 181, in _get_response > response = wrapped_callback(request, *callback_args, > **callback_kwargs) >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", > > line 616, in wrapper > return self.admin_site.admin_view(view)(*args, **kwargs) >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", > line 130, in _wrapped_view > response = view_func(request, *args, **kwargs) >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\views\decorators\cache.py", > > line 44, in _wrapped_view_func > response = view_func(request, *args, **kwargs) >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\sites.py", > line 232, in inner > return view(request, *args, **kwargs) >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", > line 43, in _wrapper > return bound_method(*args, **kwargs) >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", > line 130, in _wrapped_view > response = view_func(request, *args, **kwargs) >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", > > line 1739, in changelist_view > response = self.response_action(request, > queryset=cl.get_queryset(request)) >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", > > line 1408, in response_action > response = func(self, request, queryset) >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\actions.py", > > line 45, in delete_selected > modeladmin.delete_queryset(request, queryset) >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", > > line 1109, in delete_queryset > queryset.delete() >File > "D:\Users\mike\envs\xxai\lib\site-packages\django\db\models\query.py", > line 728, in delete > raise TypeError('Cannot call delete() after .distinct().') > > Exception Type: TypeError at /admin/chemical/chemical/ > Exception Value: Cannot call delete() after .distinct(). > > -- > Signed email is an absolute defence against phishing. This email has > been signed with my private key. If you import my public key you can > automatically decrypt my signature and be sure it came from me. Just > ask and I'll send it to you. Your email software can handle signing. > > > -- > 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 django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/4ceeffab-480a-aecd-a12d-01f183598d57%40dewhirst.com.au > . > -- 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 django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKGT9mzGL34KymQ30B30yn39SY0iDvPvXShoqRvamVyBhqVa%2Bw%40mail.gmail.com.
Re: Admin TypeError - Cannot call delete() after .distinct()
https://code.djangoproject.com/ticket/32682 might be the root cause, which was fixed end of April and part of the 3.2.1 release, doesn't seem like its been backported to 3.1 On Friday, July 2, 2021 at 2:03:28 AM UTC-4 Mike Dewhirst wrote: > Trying to delete a record in the Admin list view by checking the > checkbox and selecting the delete action and clicking [Go] the following > 500 error happened. > > It seems to be all within the Admin so I'm not sure how to proceed from > here. > > Thanks for any hints > > Mike > > Traceback (most recent call last): > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\core\handlers\exception.py", > > > line 47, in inner > response = get_response(request) > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\core\handlers\base.py", > line 181, in _get_response > response = wrapped_callback(request, *callback_args, **callback_kwargs) > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", > > line 616, in wrapper > return self.admin_site.admin_view(view)(*args, **kwargs) > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", > line 130, in _wrapped_view > response = view_func(request, *args, **kwargs) > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\views\decorators\cache.py", > > line 44, in _wrapped_view_func > response = view_func(request, *args, **kwargs) > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\sites.py", > line 232, in inner > return view(request, *args, **kwargs) > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", > line 43, in _wrapper > return bound_method(*args, **kwargs) > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", > line 130, in _wrapped_view > response = view_func(request, *args, **kwargs) > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", > > line 1739, in changelist_view > response = self.response_action(request, > queryset=cl.get_queryset(request)) > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", > > line 1408, in response_action > response = func(self, request, queryset) > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\actions.py", > > line 45, in delete_selected > modeladmin.delete_queryset(request, queryset) > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", > > line 1109, in delete_queryset > queryset.delete() > File > "D:\Users\mike\envs\xxai\lib\site-packages\django\db\models\query.py", > line 728, in delete > raise TypeError('Cannot call delete() after .distinct().') > > Exception Type: TypeError at /admin/chemical/chemical/ > Exception Value: Cannot call delete() after .distinct(). > > -- > Signed email is an absolute defence against phishing. This email has > been signed with my private key. If you import my public key you can > automatically decrypt my signature and be sure it came from me. Just > ask and I'll send it to you. Your email software can handle signing. > > > -- 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 django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/086bef60-4422-4021-949b-84e19e9768b2n%40googlegroups.com.
Admin TypeError - Cannot call delete() after .distinct()
Trying to delete a record in the Admin list view by checking the checkbox and selecting the delete action and clicking [Go] the following 500 error happened. It seems to be all within the Admin so I'm not sure how to proceed from here. Thanks for any hints Mike Traceback (most recent call last): File "D:\Users\mike\envs\xxai\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "D:\Users\mike\envs\xxai\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 616, in wrapper return self.admin_site.admin_view(view)(*args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", line 130, in _wrapped_view response = view_func(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\views\decorators\cache.py", line 44, in _wrapped_view_func response = view_func(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\sites.py", line 232, in inner return view(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", line 43, in _wrapper return bound_method(*args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\utils\decorators.py", line 130, in _wrapped_view response = view_func(request, *args, **kwargs) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 1739, in changelist_view response = self.response_action(request, queryset=cl.get_queryset(request)) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 1408, in response_action response = func(self, request, queryset) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\actions.py", line 45, in delete_selected modeladmin.delete_queryset(request, queryset) File "D:\Users\mike\envs\xxai\lib\site-packages\django\contrib\admin\options.py", line 1109, in delete_queryset queryset.delete() File "D:\Users\mike\envs\xxai\lib\site-packages\django\db\models\query.py", line 728, in delete raise TypeError('Cannot call delete() after .distinct().') Exception Type: TypeError at /admin/chemical/chemical/ Exception Value: Cannot call delete() after .distinct(). -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature and be sure it came from me. Just ask and I'll send it to you. Your email software can handle signing. -- 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 django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4ceeffab-480a-aecd-a12d-01f183598d57%40dewhirst.com.au. OpenPGP_signature Description: OpenPGP digital signature