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

rdbms - what exactly the undo information lives in oracle? -

bash - How do you programmatically add a bats test? -

java - Getting exception in JDBC thin driver -