-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: FAB_INDEX_VIEW type check (#1883)
* fix: FAB_INDEX_VIEW type check * fix lint and init of index view
- Loading branch information
Showing
7 changed files
with
92 additions
and
75 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +0,0 @@ | ||
import logging | ||
|
||
from flask import Flask | ||
from flask_appbuilder import AppBuilder, SQLA | ||
|
||
logging.basicConfig(format="%(asctime)s:%(levelname)s:%(name)s:%(message)s") | ||
logging.getLogger().setLevel(logging.DEBUG) | ||
|
||
db = SQLA() | ||
appbuilder = AppBuilder() | ||
|
||
|
||
def create_app(config): | ||
app = Flask(__name__) | ||
with app.app_context(): | ||
app.config.from_object(config) | ||
db.init_app(app) | ||
appbuilder.init_app(app, db.session) | ||
from . import views # noqa | ||
|
||
db.create_all() | ||
appbuilder.post_init() | ||
views.fill_gender() | ||
return app | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import logging | ||
|
||
from flask import Flask | ||
from flask_appbuilder import AppBuilder, SQLA | ||
|
||
logging.basicConfig(format="%(asctime)s:%(levelname)s:%(name)s:%(message)s") | ||
logging.getLogger().setLevel(logging.DEBUG) | ||
|
||
|
||
def create_app(config): | ||
app = Flask(__name__) | ||
db = SQLA() | ||
appbuilder = AppBuilder() | ||
with app.app_context(): | ||
app.config.from_object(config) | ||
db.init_app(app) | ||
appbuilder.init_app(app, db.session) | ||
|
||
from .views import ContactModelView, GroupModelView, fill_gender | ||
|
||
appbuilder.add_view( | ||
ContactModelView, | ||
"List Contacts", | ||
icon="fa-envelope", | ||
category="Contacts", | ||
category_icon="fa-envelope", | ||
) | ||
|
||
appbuilder.add_view( | ||
GroupModelView, "List Groups", icon="fa-folder-open-o", category="Contacts" | ||
) | ||
|
||
db.create_all() | ||
appbuilder.post_init() | ||
fill_gender() | ||
return app |
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
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
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
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