Are there any options of auto-generated admin panel for gino models? I tried to use gino models on Flask-admin, but had no luck with it (_sa_instance_state_manager attribute was missing).
Oh yes, we used Flask-Admin in one of our project with GINO. The trick is to replace gino.Gino with flask_sqlalchemy.SQLAlchemy, thanks to duck typing. Here's the code:
import os
if os.environ.get('FLASK_APP')
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
else:
from gino.ext.sanic import Gino
db = Gino()
def init_app(app):
from . import accounting, deposit, product, timeline, user
db.init_app(app)
As you can see, I used environment variable FLASK_APP to find out if current process is a Flask-Admin server or a Sanic API server. You can replace it with whatever suits you. Then you can use ModelView of Flask-Admin to make it work. However this is very hacky and may break at any time, please be noted. Good luck!
Also I'm planning to build such a admin console with GINO, GraphQL and Vue.js. But that is a long story.
Thanks a lot, Dear Sir, may The Force be with you!
Quite welcome you are. 馃樃
Maybe will be useful for someone: https://github.com/xnuinside/gino_admin . It's in active development now, but CRUD & upload from csv already works
@xnuinside thanks for using and sharing! This is now added on https://python-gino.org/credits/
refs #260, https://github.com/python-gino/python-gino.org/commit/f45fe7fd2bd58285438281dcdbbeef8787661207