Reputation: 3432
I have a flask app with a peewee model that is using flask-admin. I want to enable the editing of JSONB fields in the popup. I have set column_editable_list to the JSONB field in my model:
class AuthModelView(AuthMixinView, BaseModelView):
column_editable_list = ('attrs',)
The JSONB field itself is declared:
attrs = BinaryJSONField()
I'm not sure what I have to do to get the JSON to show up in the editable popup instead of the [object Object].
I tried defining str, unicode, and repr methods on the model containing the JSONB attrs but that didn't work. Do I have to define a custom XEditableWidget?
It's worth noting that the edit form is able to display and edit the JSON:
I don't see why the inline form doesn't use the same field type mapping?
Upvotes: 2
Views: 1695
Reputation: 354
This feature was added here: https://github.com/flask-admin/flask-admin/pull/1245
It's on the current master branch and should go out with the 1.4.0 release.
Upvotes: 2