How to show a JSON value in Flask-Admin as separate fields?

46 Views Asked by At

Hi Stackoverflow community,

I'm trying to learn Flask-Admin. The documentation is a very good start, however I've found a very specific use-case that I'm not able to resolve. I have a table in PostgreSQL for variables. I've chosen for this approach since I've got quite a lot of variables but they don't share the same attributes (for example, the region doesn't have the property email).

Variable Value
User1 {"name": "Name", "email": "[email protected]"}
Region1 {"region": "Europe", "name": "DHL", "color": "blue"}

I'd like to have the functionality that the end-user can edit the variables themselves. They don't have any knowledge about JSON of course so it would be nice to render out the fields. Currently it's one field where the JSON value is. It would be perfect if there's a field for every item in the edit view in Flask-Admin. For example this would mean that editing the User1 variable shows 2 fields, one for name and one for email.

0

There are 0 best solutions below