python - How to generate a model from PostgreSQL JSON data type for using it with Flask-Admin -


i'm using postgresql database column defined json acts datastore flask app, using sqlalechemy. idea creating model column, can interact pretty mongoengine , mongodb. goal provide model flask-admin.

with mongoengine can like:

class user(document):     email = stringfield(required=true)     first_name = stringfield(max_length=50)     last_name = stringfield(max_length=50) 

i want similar json column in postresql. possible?

in case, flask-admin wants schema models - needs know columns available.

i'd suggest implementing custom model backend , use pymongo backend example: https://github.com/mrjoes/flask-admin/tree/master/flask_admin/contrib/pymongo

it not hard (under 150 lines of code).


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jquery - Keeping Kendo Datepicker in min/max range -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -