Closed palewis closed 11 years ago
Hello,
I'm unable to reproduce this issue of my own. Can you please provide additional examples? Do you use any custom delete methods in your ModelAdmin class?
From your error message it seems like you are using the GChartsQuerySet to manage your delete, which are not supported. That's why you need to set up both the objects = models.Manager()
and the gcharts = GChartsManager()
which it seems like you have done correctly.
As long as you make sure the delete is executed with the objects
manager, everything should be fine, but as far as I can see from the tracelog, the delete is beeing executed through the gcharts
manager.
Do you use any custom delete methods in your ModelAdmin class?
No
From your error message it seems like you are using the GChartsQuerySet to manage your delete
I am not doing so explicitly. I'm using the stock 'admin' app that comes with Django to attempt to delete the object. Is it possible that the Django admin app is selecting the wrong model manager for delete? Or perhaps it iterates all managers when executing delete?
Hello, Sorry for long response time, been a bit busy with christmas stuff around here. I have now set up a small project from scratch here to try to figure out what's going on, and it seems like django are using the first specified manager in your model as the default manager.
So your code should work if you define your managers like this:
class MyModel(models.Model):
objects = models.Manager()
gcharts = GChartsManager()
....
and not the other way around. I will provide a fix the next few days.
I have an object that starts like this:
When I use the admin app to try to delete such an object, I get the following traceback:
Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response