Last active
June 21, 2024 01:17
-
-
Save shijiezhou1/7a1187c9cc105ac421c2b3bf1331d3c1 to your computer and use it in GitHub Desktop.
FAB json model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model | |
from sqlalchemy.dialects.postgresql import JSON | |
class JSONModel(Model): | |
__bind_key__ = 'APP_DB' | |
__tablename__ = 'json_model' | |
id = Column(Integer, primary_key=True) | |
value = Column(JSON, nullable=True) | |
class JSONModelApi(ModelRestApi): | |
resource_name = "json_model" | |
datamodel = SQLAInterface(JSONModel) | |
allow_browser_login = True | |
appbuilder.add_api(JSONModelApi) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment