-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database Features not set for Postgres for management commands #30
Comments
Hi @valentijnscholten, thanks for the report! I'm afraid that's not something I can handle from my side. Maybe try creating a ticket to Django? The workaround seems logical, though. Thanks for sharing! |
I am using MySQL and have run into this as well. In addition to management commands, I dug into it and found that the I've created a pull request that calls |
Fixed in v1.0.5, please verify. Thanks! |
For the record, it's fixed in #39 |
Hi,
Yes, I have added
django-jsonfield-backport
toINSTALLED_APPS
.Might be that the cause of the below is somewhere else / somewhere upstream in django, but I am seeing the following.
I have an application that works find with a json field on a model. I can delete that model just fine from the UI that have build, running with
runserver
oruwsgi
etc. It also runs fine if I try to delete model instances from a management command.When I run the same application with postgres and
runserver
oruwsgi
, it also works fine. I can delete model instances.But when I run a management command to delete model instances, I get an exception:
When debugging, it looks like the
extend_features
is not called in this scenario. Looking at the code of this backport it connects to theconnection_created
signal. For some reason this doesn't seem to be called when running as a management command against a postgres database. For MySQL it runs fine. As said, might be something upstream, but at least I can share my workaround here. I added the below to my management command to make it work:The text was updated successfully, but these errors were encountered: