-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
mongodb form_subdocument overwrite stopped working after updates to current flask/ flask-admin/ flask-mongoenine #2402
Comments
For others with the same Problem, found a solution/ workaround. You must replace None with '' to make it work again. |
I am closing this issue as we're removing support for flask-mongoengine in the next release, because that library is no longer being maintained and is incompatible with recent versions of our core dependencies (eg flask, wtforms, etc). |
@samuelhwilliams I'm I right that I need to migrate to the pymongo module then? |
If you want to use the upcoming releases of Flask-Admin, that would be my recommendation. I'd be very interested to hear about your experience migrating across - if it's painful, if/what features are missing that we may need to add to pymongo support, etc. |
@samuelhwilliams I definitely need to migrate, I heavily use the mongoengine models in this flask-admin based project https://github.com/kuhn-ruess/cmdbsyncer . I also use a lot of Embedded Documents and Styling like this: |
I had to Update the Flask etc. Modules in my Open-Source Project.
One Problem was that I had to replace flask-mongoengine with:
https://github.com/idoshr/flask-mongoengine
So when switching from old to new and reverse, I can reproduce it to work and stop working.
Sadly, I was unable to find out, which project's fault is that nor to fix it.
Even checked the last commit's every and found nothing which could have done it.
Working Versions:
Flask 2.1.2
Flask-Admin: 1.6.0
flask-mongoengine 1.0.0
wtforms 3.0.1
Not working:
Flask 3.0.0
Flask-Admin 1.6.1
flask-mongoengine forkgit@master
wtforms 3.1.1
The Problem is, that the form_widget_args, form_overwrite etc. for the subdocuments are not applied,
I can even add random field names etc. without error, only on the first level I get error messages when the field is wrong.
That's one example from my Code:
And that's the Model for it:
Because of the flask-mongoengine version switch, I had to change ListFields to have the field= param, and the EmbeddedDocuments to have the document_type.
Maybe this is related.
Thanks for any help.
The text was updated successfully, but these errors were encountered: