Browse Source

Change name to quartadmin, and depend on Quart instead of Flask

master
Raoul Snyman 6 months ago
parent
commit
a6b4a4c2f5
  1. 6
      doc/conf.py
  2. 6
      examples/appengine/app.py
  3. 6
      examples/auth-flask-login/app.py
  4. 4
      examples/auth-mongoengine/app.py
  5. 8
      examples/auth/app.py
  6. 4
      examples/babel/app.py
  7. 4
      examples/bootstrap4/app.py
  8. 4
      examples/custom-layout/app.py
  9. 6
      examples/forms-files-images/app.py
  10. 4
      examples/geo_alchemy/app.py
  11. 2
      examples/geo_alchemy/config.py
  12. 2
      examples/methodview/app.py
  13. 6
      examples/mongoengine/app.py
  14. 2
      examples/multiple-admin-instances/app.py
  15. 4
      examples/peewee/app.py
  16. 8
      examples/pymongo/app.py
  17. 2
      examples/simple/app.py
  18. 4
      examples/sqla-association_proxy/app.py
  19. 12
      examples/sqla-custom-inline-forms/app.py
  20. 12
      examples/sqla/admin/main.py
  21. 10
      examples/tinymongo/app.py
  22. 13
      flask_admin/contrib/peeweemodel/__init__.py
  23. 13
      flask_admin/contrib/sqlamodel/__init__.py
  24. 4
      quartadmin/__init__.py
  25. 2
      quartadmin/_backwards.py
  26. 2
      quartadmin/_compat.py
  27. 6
      quartadmin/actions.py
  28. 2
      quartadmin/babel.py
  29. 18
      quartadmin/base.py
  30. 0
      quartadmin/consts.py
  31. 0
      quartadmin/contrib/__init__.py
  32. 0
      quartadmin/contrib/appengine/__init__.py
  33. 0
      quartadmin/contrib/appengine/fields.py
  34. 2
      quartadmin/contrib/appengine/form.py
  35. 4
      quartadmin/contrib/appengine/view.py
  36. 14
      quartadmin/contrib/fileadmin/__init__.py
  37. 8
      quartadmin/contrib/fileadmin/azure.py
  38. 10
      quartadmin/contrib/fileadmin/s3.py
  39. 0
      quartadmin/contrib/geoa/__init__.py
  40. 2
      quartadmin/contrib/geoa/fields.py
  41. 4
      quartadmin/contrib/geoa/form.py
  42. 2
      quartadmin/contrib/geoa/typefmt.py
  43. 4
      quartadmin/contrib/geoa/view.py
  44. 0
      quartadmin/contrib/geoa/widgets.py
  45. 0
      quartadmin/contrib/mongoengine/__init__.py
  46. 4
      quartadmin/contrib/mongoengine/ajax.py
  47. 2
      quartadmin/contrib/mongoengine/fields.py
  48. 4
      quartadmin/contrib/mongoengine/filters.py
  49. 10
      quartadmin/contrib/mongoengine/form.py
  50. 2
      quartadmin/contrib/mongoengine/helpers.py
  51. 6
      quartadmin/contrib/mongoengine/subdoc.py
  52. 0
      quartadmin/contrib/mongoengine/tools.py
  53. 2
      quartadmin/contrib/mongoengine/typefmt.py
  54. 30
      quartadmin/contrib/mongoengine/view.py
  55. 4
      quartadmin/contrib/mongoengine/widgets.py
  56. 0
      quartadmin/contrib/peewee/__init__.py
  57. 4
      quartadmin/contrib/peewee/ajax.py
  58. 4
      quartadmin/contrib/peewee/filters.py
  59. 8
      quartadmin/contrib/peewee/form.py
  60. 0
      quartadmin/contrib/peewee/tools.py
  61. 20
      quartadmin/contrib/peewee/view.py
  62. 13
      quartadmin/contrib/peeweemodel/__init__.py
  63. 0
      quartadmin/contrib/pymongo/__init__.py
  64. 4
      quartadmin/contrib/pymongo/filters.py
  65. 0
      quartadmin/contrib/pymongo/tools.py
  66. 0
      quartadmin/contrib/pymongo/typefmt.py
  67. 24
      quartadmin/contrib/pymongo/view.py
  68. 4
      quartadmin/contrib/rediscli.py
  69. 0
      quartadmin/contrib/sqla/__init__.py
  70. 4
      quartadmin/contrib/sqla/ajax.py
  71. 10
      quartadmin/contrib/sqla/fields.py
  72. 6
      quartadmin/contrib/sqla/filters.py
  73. 14
      quartadmin/contrib/sqla/form.py
  74. 4
      quartadmin/contrib/sqla/tools.py
  75. 2
      quartadmin/contrib/sqla/typefmt.py
  76. 2
      quartadmin/contrib/sqla/validators.py
  77. 36
      quartadmin/contrib/sqla/view.py
  78. 2
      quartadmin/contrib/sqla/widgets.py
  79. 13
      quartadmin/contrib/sqlamodel/__init__.py
  80. 4
      quartadmin/form/__init__.py
  81. 4
      quartadmin/form/fields.py
  82. 4
      quartadmin/form/rules.py
  83. 8
      quartadmin/form/upload.py
  84. 2
      quartadmin/form/validators.py
  85. 4
      quartadmin/form/widgets.py
  86. 6
      quartadmin/helpers.py
  87. 0
      quartadmin/menu.py
  88. 2
      quartadmin/model/__init__.py
  89. 0
      quartadmin/model/ajax.py
  90. 42
      quartadmin/model/base.py
  91. 2
      quartadmin/model/fields.py
  92. 4
      quartadmin/model/filters.py
  93. 4
      quartadmin/model/form.py
  94. 0
      quartadmin/model/helpers.py
  95. 4
      quartadmin/model/template.py
  96. 2
      quartadmin/model/typefmt.py
  97. 10
      quartadmin/model/widgets.py
  98. 0
      quartadmin/static/admin/css/bootstrap2/admin.css
  99. 0
      quartadmin/static/admin/css/bootstrap2/rediscli.css
  100. 0
      quartadmin/static/admin/css/bootstrap3/admin.css

6
doc/conf.py

@ -17,8 +17,8 @@ import sys, os
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
import flask_admin
from flask_admin import __version__
import quartadmin
from quartadmin import __version__
# -- General configuration -----------------------------------------------------
@ -57,7 +57,7 @@ release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
locale_dirs = ['../flask_admin/translations/']
locale_dirs = ['../quartadmin/translations/']
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:

6
examples/appengine/app.py

@ -1,7 +1,7 @@
from flask import Flask
import flask_admin
from flask_admin.contrib import appengine
import quartadmin
from quartadmin.contrib import appengine
from google.appengine.ext import db
from google.appengine.ext import ndb
@ -11,7 +11,7 @@ app = Flask(__name__)
# Create dummy secrey key so we can use sessions
app.config['SECRET_KEY'] = '123456790'
admin = flask_admin.Admin(app, name="Admin")
admin = quartadmin.Admin(app, name="Admin")
# Flask views
@app.route('/')

6
examples/auth-flask-login/app.py

@ -2,10 +2,10 @@ import os
from flask import Flask, url_for, redirect, render_template, request
from flask_sqlalchemy import SQLAlchemy
from wtforms import form, fields, validators
import flask_admin as admin
import quartadmin as admin
import flask_login as login
from flask_admin.contrib import sqla
from flask_admin import helpers, expose
from quartadmin.contrib import sqla
from quartadmin import helpers, expose
from werkzeug.security import generate_password_hash, check_password_hash

4
examples/auth-mongoengine/app.py

@ -3,9 +3,9 @@ from flask_mongoengine import MongoEngine
from wtforms import form, fields, validators
import flask_admin as admin
import quartadmin as admin
import flask_login as login
from flask_admin.contrib.mongoengine import ModelView
from quartadmin.contrib.mongoengine import ModelView
# Create application
app = Flask(__name__)

8
examples/auth/app.py

@ -4,9 +4,9 @@ from flask_sqlalchemy import SQLAlchemy
from flask_security import Security, SQLAlchemyUserDatastore, \
UserMixin, RoleMixin, login_required, current_user
from flask_security.utils import encrypt_password
import flask_admin
from flask_admin.contrib import sqla
from flask_admin import helpers as admin_helpers
import quartadmin
from quartadmin.contrib import sqla
from quartadmin import helpers as admin_helpers
# Create Flask application
@ -78,7 +78,7 @@ def index():
return render_template('index.html')
# Create admin
admin = flask_admin.Admin(
admin = quartadmin.Admin(
app,
'Example: Auth',
base_template='my_master.html',

4
examples/babel/app.py

@ -1,10 +1,10 @@
from flask import Flask, request, session
from flask_sqlalchemy import SQLAlchemy
import flask_admin as admin
import quartadmin as admin
from flask_babelex import Babel
from flask_admin.contrib import sqla
from quartadmin.contrib import sqla
# Create application
app = Flask(__name__)

4
examples/bootstrap4/app.py

@ -4,8 +4,8 @@ import os.path as op
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import flask_admin as admin
from flask_admin.contrib.sqla import ModelView
import quartadmin as admin
from quartadmin.contrib.sqla import ModelView
# Create application

4
examples/custom-layout/app.py

@ -3,8 +3,8 @@ import os.path as op
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import flask_admin as admin
from flask_admin.contrib.sqla import ModelView
import quartadmin as admin
from quartadmin.contrib.sqla import ModelView
# Create application

6
examples/forms-files-images/app.py

@ -9,9 +9,9 @@ from wtforms import fields, widgets
from sqlalchemy.event import listens_for
from MarkupSafe import Markup
from flask_admin import Admin, form
from flask_admin.form import rules
from flask_admin.contrib import sqla, rediscli
from quartadmin import Admin, form
from quartadmin.form import rules
from quartadmin.contrib import sqla, rediscli
# Create application

4
examples/geo_alchemy/app.py

@ -1,9 +1,9 @@
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import flask_admin as admin
import quartadmin as admin
from geoalchemy2.types import Geometry
from flask_admin.contrib.geoa import ModelView
from quartadmin.contrib.geoa import ModelView
# Create application

2
examples/geo_alchemy/config.py

@ -2,7 +2,7 @@
SECRET_KEY = '123456790'
# database connection
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://flask_admin_geo:flask_admin_geo@localhost/flask_admin_geo'
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://quartadmin_geo:quartadmin_geo@localhost/quartadmin_geo'
SQLALCHEMY_ECHO = True
# credentials for loading map tiles from mapbox

2
examples/methodview/app.py

@ -1,6 +1,6 @@
from flask import Flask, redirect, request
import flask_admin as admin
import quartadmin as admin
from flask.views import MethodView

6
examples/mongoengine/app.py

@ -2,10 +2,10 @@ import datetime
from flask import Flask
import flask_admin as admin
import quartadmin as admin
from flask_mongoengine import MongoEngine
from flask_admin.form import rules
from flask_admin.contrib.mongoengine import ModelView
from quartadmin.form import rules
from quartadmin.contrib.mongoengine import ModelView
# Create application
app = Flask(__name__)

2
examples/multiple-admin-instances/app.py

@ -1,6 +1,6 @@
from flask import Flask
import flask_admin as admin
import quartadmin as admin
# Views

4
examples/peewee/app.py

@ -3,8 +3,8 @@ import uuid
import peewee
from flask import Flask
import flask_admin as admin
from flask_admin.contrib.peewee import ModelView
import quartadmin as admin
from quartadmin.contrib.peewee import ModelView
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'

8
examples/pymongo/app.py

@ -2,13 +2,13 @@ import pymongo
from bson.objectid import ObjectId
from flask import Flask
import flask_admin as admin
import quartadmin as admin
from wtforms import form, fields
from flask_admin.form import Select2Widget
from flask_admin.contrib.pymongo import ModelView, filters
from flask_admin.model.fields import InlineFormField, InlineFieldList
from quartadmin.form import Select2Widget
from quartadmin.contrib.pymongo import ModelView, filters
from quartadmin.model.fields import InlineFormField, InlineFieldList
# Create application
app = Flask(__name__)

2
examples/simple/app.py

@ -1,6 +1,6 @@
from flask import Flask
import flask_admin as admin
import quartadmin as admin
# Create custom admin view

4
examples/sqla-association_proxy/app.py

@ -3,8 +3,8 @@ from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import relationship, backref
import flask_admin as admin
from flask_admin.contrib import sqla
import quartadmin as admin
from quartadmin.contrib import sqla
# Create application
app = Flask(__name__)

12
examples/sqla-custom-inline-forms/app.py

@ -9,12 +9,12 @@ from flask_sqlalchemy import SQLAlchemy
from wtforms import fields
import flask_admin as admin
from flask_admin.form import RenderTemplateWidget
from flask_admin.model.form import InlineFormAdmin
from flask_admin.contrib.sqla import ModelView
from flask_admin.contrib.sqla.form import InlineModelConverter
from flask_admin.contrib.sqla.fields import InlineModelFormList
import quartadmin as admin
from quartadmin.form import RenderTemplateWidget
from quartadmin.model.form import InlineFormAdmin
from quartadmin.contrib.sqla import ModelView
from quartadmin.contrib.sqla.form import InlineModelConverter
from quartadmin.contrib.sqla.fields import InlineModelFormList
# Create application
app = Flask(__name__)

12
examples/sqla/admin/main.py

@ -4,12 +4,12 @@ from flask import Markup, send_file
from wtforms import validators
import flask_admin as admin
from flask_admin.base import MenuLink
from flask_admin.contrib import sqla
from flask_admin.contrib.sqla import filters
from flask_admin.contrib.sqla.filters import BaseSQLAFilter, FilterEqual
from flask_admin.babel import gettext
import quartadmin as admin
from quartadmin.base import MenuLink
from quartadmin.contrib import sqla
from quartadmin.contrib.sqla import filters
from quartadmin.contrib.sqla.filters import BaseSQLAFilter, FilterEqual
from quartadmin.babel import gettext
# Flask views

10
examples/tinymongo/app.py

@ -5,11 +5,11 @@ refer to README.txt for instructions
Author: Bruno Rocha <@rochacbruno>
Based in PyMongo Example and TinyMongo
"""
import flask_admin as admin
import quartadmin as admin
from flask import Flask
from flask_admin.contrib.pymongo import ModelView, filters
from flask_admin.form import Select2Widget
from flask_admin.model.fields import InlineFieldList, InlineFormField
from quartadmin.contrib.pymongo import ModelView, filters
from quartadmin.form import Select2Widget
from quartadmin.model.fields import InlineFieldList, InlineFormField
from wtforms import fields, form
from tinymongo import TinyMongoClient
@ -22,7 +22,7 @@ app.config['SECRET_KEY'] = '123456790'
# Create models in a JSON file localted at
DATAFOLDER = '/tmp/flask_admin_test'
DATAFOLDER = '/tmp/quartadmin_test'
conn = TinyMongoClient(DATAFOLDER)
db = conn.test

13
flask_admin/contrib/peeweemodel/__init__.py

@ -1,13 +0,0 @@
def setup():
import warnings
warnings.warn('Flask-Admin peewee integration module was renamed as '
'flask_admin.contrib.peewee, please use it instead.')
from flask_admin._backwards import import_redirect
import_redirect(__name__, 'flask_admin.contrib.peewee')
setup()
del setup
from ..peewee.view import ModelView # noqa: F401

13
flask_admin/contrib/sqlamodel/__init__.py

@ -1,13 +0,0 @@
def setup():
import warnings
warnings.warn('Flask-Admin sqlalchemy integration module was renamed as '
'flask_admin.contrib.sqla, please use it instead.')
from flask_admin._backwards import import_redirect
import_redirect(__name__, 'flask_admin.contrib.sqla')
setup()
del setup
from ..sqla.view import ModelView # noqa: F401

4
flask_admin/__init__.py → quartadmin/__init__.py

@ -1,6 +1,6 @@
__version__ = '1.6.0'
__author__ = 'Flask-Admin team'
__email__ = 'serge.koval+github@gmail.com'
__author__ = 'Raoul Snyman'
__email__ = 'raoul@snyman.info'
from .base import expose, expose_plugview, Admin, BaseView, AdminIndexView # noqa: F401

2
flask_admin/_backwards.py → quartadmin/_backwards.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""
flask_admin._backwards
quartadmin._backwards
~~~~~~~~~~~~~~~~~~~~~~~~~~
Backward compatibility helpers.

2
flask_admin/_compat.py → quartadmin/_compat.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# flake8: noqa
"""
flask_admin._compat
quartadmin._compat
~~~~~~~~~~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down

6
flask_admin/actions.py → quartadmin/actions.py

@ -1,9 +1,9 @@
from flask import request, redirect
from flask_admin import tools
from flask_admin._compat import text_type
from flask_admin.helpers import get_redirect_target, flash_errors
from quartadmin import tools
from quartadmin._compat import text_type
from quartadmin.helpers import get_redirect_target, flash_errors
def action(name, text, confirmation=None):

2
flask_admin/babel.py → quartadmin/babel.py

@ -23,7 +23,7 @@ except ImportError:
def ngettext(self, singular, plural, n):
return singular if n == 1 else plural
else:
from flask_admin import translations
from quartadmin import translations
class CustomDomain(Domain):
def __init__(self):

18
flask_admin/base.py → quartadmin/base.py

@ -4,12 +4,12 @@ import warnings
from functools import wraps
from flask import Blueprint, current_app, render_template, abort, g, url_for
from flask_admin import babel
from flask_admin._compat import with_metaclass, as_unicode
from flask_admin import helpers as h
from quartadmin import babel
from quartadmin._compat import with_metaclass, as_unicode
from quartadmin import helpers as h
# For compatibility reasons import MenuLink
from flask_admin.menu import MenuCategory, MenuView, MenuLink, SubMenuCategory # noqa: F401
from quartadmin.menu import MenuCategory, MenuView, MenuLink, SubMenuCategory # noqa: F401
def expose(url='/', methods=('GET',)):
@ -112,7 +112,7 @@ class BaseView(with_metaclass(AdminViewMeta, BaseViewClass)):
Derive from this class to implement your administrative interface piece. For example::
from flask_admin import BaseView, expose
from quartadmin import BaseView, expose
class MyView(BaseView):
@expose('/')
def index(self):
@ -180,10 +180,10 @@ class BaseView(with_metaclass(AdminViewMeta, BaseViewClass)):
:param menu_icon_type:
Optional icon. Possible icon types:
- `flask_admin.consts.ICON_TYPE_GLYPH` - Bootstrap glyph icon
- `flask_admin.consts.ICON_TYPE_FONT_AWESOME` - Font Awesome icon
- `flask_admin.consts.ICON_TYPE_IMAGE` - Image relative to Flask static directory
- `flask_admin.consts.ICON_TYPE_IMAGE_URL` - Image with full URL
- `quartadmin.consts.ICON_TYPE_GLYPH` - Bootstrap glyph icon
- `quartadmin.consts.ICON_TYPE_FONT_AWESOME` - Font Awesome icon
- `quartadmin.consts.ICON_TYPE_IMAGE` - Image relative to Flask static directory
- `quartadmin.consts.ICON_TYPE_IMAGE_URL` - Image with full URL
:param menu_icon_value:
Icon glyph name or URL, depending on `menu_icon_type` setting
"""

0
flask_admin/consts.py → quartadmin/consts.py

0
flask_admin/contrib/__init__.py → quartadmin/contrib/__init__.py

0
flask_admin/contrib/appengine/__init__.py → quartadmin/contrib/appengine/__init__.py

0
flask_admin/contrib/appengine/fields.py → quartadmin/contrib/appengine/fields.py

2
flask_admin/contrib/appengine/form.py → quartadmin/contrib/appengine/form.py

@ -1,6 +1,6 @@
from wtforms_appengine.ndb import ModelConverter
from .fields import GeoPtPropertyField
from flask_admin.model.form import converts
from quartadmin.model.form import converts
class AdminModelConverter(ModelConverter):

4
flask_admin/contrib/appengine/view.py → quartadmin/contrib/appengine/view.py

@ -1,6 +1,6 @@
import logging
from flask_admin.model import BaseModelView
from quartadmin.model import BaseModelView
from wtforms_appengine import db as wt_db
from wtforms_appengine import ndb as wt_ndb
@ -8,7 +8,7 @@ from google.appengine.ext import db
from google.appengine.ext import ndb
from flask_wtf import Form
from flask_admin.model.form import create_editable_list_form
from quartadmin.model.form import create_editable_list_form
from .form import AdminModelConverter

14
flask_admin/contrib/fileadmin/__init__.py → quartadmin/contrib/fileadmin/__init__.py

@ -11,11 +11,11 @@ from flask import flash, redirect, abort, request, send_file
from werkzeug.utils import secure_filename
from wtforms import fields, validators
from flask_admin import form, helpers
from flask_admin._compat import urljoin, as_unicode, quote
from flask_admin.base import BaseView, expose
from flask_admin.actions import action, ActionsMixin
from flask_admin.babel import gettext, lazy_gettext
from quartadmin import form, helpers
from quartadmin._compat import urljoin, as_unicode, quote
from quartadmin.base import BaseView, expose
from quartadmin.actions import action, ActionsMixin
from quartadmin.babel import gettext, lazy_gettext
class LocalFileStorage(object):
@ -1226,8 +1226,8 @@ class FileAdmin(BaseFileAdmin):
import os.path as op
from flask_admin import Admin
from flask_admin.contrib.fileadmin import FileAdmin
from quartadmin import Admin
from quartadmin.contrib.fileadmin import FileAdmin
admin = Admin()

8
flask_admin/contrib/fileadmin/azure.py → quartadmin/contrib/fileadmin/azure.py

@ -21,8 +21,8 @@ class AzureStorage(object):
Usage::
from flask_admin.contrib.fileadmin import BaseFileAdmin
from flask_admin.contrib.fileadmin.azure import AzureStorage
from quartadmin.contrib.fileadmin import BaseFileAdmin
from quartadmin.contrib.fileadmin.azure import AzureStorage
class MyAzureAdmin(BaseFileAdmin):
# Configure your class however you like
@ -254,8 +254,8 @@ class AzureFileAdmin(BaseFileAdmin):
Sample usage::
from flask_admin import Admin
from flask_admin.contrib.fileadmin.azure import AzureFileAdmin
from quartadmin import Admin
from quartadmin.contrib.fileadmin.azure import AzureFileAdmin
admin = Admin()

10
flask_admin/contrib/fileadmin/s3.py → quartadmin/contrib/fileadmin/s3.py

@ -8,7 +8,7 @@ except ImportError:
s3 = None
from flask import redirect
from flask_admin.babel import gettext
from quartadmin.babel import gettext
from . import BaseFileAdmin
@ -19,8 +19,8 @@ class S3Storage(object):
Usage::
from flask_admin.contrib.fileadmin import BaseFileAdmin
from flask_admin.contrib.fileadmin.s3 import S3Storage
from quartadmin.contrib.fileadmin import BaseFileAdmin
from quartadmin.contrib.fileadmin.s3 import S3Storage
class MyS3Admin(BaseFileAdmin):
# Configure your class however you like
@ -196,8 +196,8 @@ class S3FileAdmin(BaseFileAdmin):
Sample usage::
from flask_admin import Admin
from flask_admin.contrib.fileadmin.s3 import S3FileAdmin
from quartadmin import Admin
from quartadmin.contrib.fileadmin.s3 import S3FileAdmin
admin = Admin()

0
flask_admin/contrib/geoa/__init__.py → quartadmin/contrib/geoa/__init__.py

2
flask_admin/contrib/geoa/fields.py → quartadmin/contrib/geoa/fields.py

@ -2,7 +2,7 @@ import geoalchemy2
from shapely.geometry import shape
from sqlalchemy import func
from flask_admin.form import JSONField
from quartadmin.form import JSONField
from .widgets import LeafletWidget

4
flask_admin/contrib/geoa/form.py → quartadmin/contrib/geoa/form.py

@ -1,5 +1,5 @@
from flask_admin.model.form import converts
from flask_admin.contrib.sqla.form import AdminModelConverter as SQLAAdminConverter
from quartadmin.model.form import converts
from quartadmin.contrib.sqla.form import AdminModelConverter as SQLAAdminConverter
from .fields import GeoJSONField

2
flask_admin/contrib/geoa/typefmt.py → quartadmin/contrib/geoa/typefmt.py

@ -1,4 +1,4 @@
from flask_admin.contrib.sqla.typefmt import DEFAULT_FORMATTERS as BASE_FORMATTERS
from quartadmin.contrib.sqla.typefmt import DEFAULT_FORMATTERS as BASE_FORMATTERS
from markupsafe import Markup
from wtforms.widgets import html_params
from geoalchemy2.shape import to_shape

4
flask_admin/contrib/geoa/view.py → quartadmin/contrib/geoa/view.py

@ -1,5 +1,5 @@
from flask_admin.contrib.sqla import ModelView as SQLAModelView
from flask_admin.contrib.geoa import form, typefmt
from quartadmin.contrib.sqla import ModelView as SQLAModelView
from quartadmin.contrib.geoa import form, typefmt
class ModelView(SQLAModelView):

0
flask_admin/contrib/geoa/widgets.py → quartadmin/contrib/geoa/widgets.py

0
flask_admin/contrib/mongoengine/__init__.py → quartadmin/contrib/mongoengine/__init__.py

4
flask_admin/contrib/mongoengine/ajax.py → quartadmin/contrib/mongoengine/ajax.py

@ -1,7 +1,7 @@
import mongoengine
from flask_admin._compat import string_types, as_unicode, iteritems
from flask_admin.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE
from quartadmin._compat import string_types, as_unicode, iteritems
from quartadmin.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE
class QueryAjaxModelLoader(AjaxModelLoader):

2
flask_admin/contrib/mongoengine/fields.py → quartadmin/contrib/mongoengine/fields.py

@ -10,7 +10,7 @@ except ImportError:
from wtforms.utils import unset_value
from . import widgets
from flask_admin.model.fields import InlineFormField
from quartadmin.model.fields import InlineFormField
def is_empty(file_object):

4
flask_admin/contrib/mongoengine/filters.py → quartadmin/contrib/mongoengine/filters.py

@ -1,5 +1,5 @@
from flask_admin.babel import lazy_gettext
from flask_admin.model import filters
from quartadmin.babel import lazy_gettext
from quartadmin.model import filters
from .tools import parse_like_term
from mongoengine.queryset import Q

10
flask_admin/contrib/mongoengine/form.py → quartadmin/contrib/mongoengine/form.py

@ -4,11 +4,11 @@ from mongoengine.base import BaseDocument, DocumentMetaclass, get_document
from wtforms import fields, validators
from flask_mongoengine.wtf import orm, fields as mongo_fields
from flask_admin import form
from flask_admin.model.form import FieldPlaceholder
from flask_admin.model.fields import InlineFieldList, AjaxSelectField, AjaxSelectMultipleField
from flask_admin.form.validators import FieldListInputRequired
from flask_admin._compat import iteritems
from quartadmin import form
from quartadmin.model.form import FieldPlaceholder
from quartadmin.model.fields import InlineFieldList, AjaxSelectField, AjaxSelectMultipleField
from quartadmin.form.validators import FieldListInputRequired
from quartadmin._compat import iteritems
from .fields import ModelFormField, MongoFileField, MongoImageField
from .subdoc import EmbeddedForm

2
flask_admin/contrib/mongoengine/helpers.py → quartadmin/contrib/mongoengine/helpers.py

@ -1,6 +1,6 @@
from mongoengine import ValidationError
from wtforms.validators import ValidationError as wtfValidationError
from flask_admin._compat import itervalues, as_unicode
from quartadmin._compat import itervalues, as_unicode
def make_gridfs_args(value):

6
flask_admin/contrib/mongoengine/subdoc.py → quartadmin/contrib/mongoengine/subdoc.py

@ -1,5 +1,5 @@
from flask_admin._compat import iteritems
from flask_admin.model.form import InlineBaseFormAdmin
from quartadmin._compat import iteritems
from quartadmin.model.form import InlineBaseFormAdmin
class EmbeddedForm(InlineBaseFormAdmin):
@ -19,6 +19,6 @@ def convert_subdocuments(values):
result[name] = p
else:
raise ValueError('Invalid subdocument type: expecting dict or '
'instance of flask_admin.contrib.mongoengine.EmbeddedForm, got %s' % type(p))
'instance of quartadmin.contrib.mongoengine.EmbeddedForm, got %s' % type(p))
return result

0
flask_admin/contrib/mongoengine/tools.py → quartadmin/contrib/mongoengine/tools.py

2
flask_admin/contrib/mongoengine/typefmt.py → quartadmin/contrib/mongoengine/typefmt.py

@ -3,7 +3,7 @@ from markupsafe import Markup, escape
from mongoengine.base import BaseList
from mongoengine.fields import GridFSProxy, ImageGridFsProxy
from flask_admin.model.typefmt import BASE_FORMATTERS, list_formatter
from quartadmin.model.typefmt import BASE_FORMATTERS, list_formatter
from . import helpers

30
flask_admin/contrib/mongoengine/view.py → quartadmin/contrib/mongoengine/view.py

@ -2,18 +2,18 @@ import logging
from flask import request, flash, abort, Response
from flask_admin import expose
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.model import BaseModelView
from flask_admin.model.form import create_editable_list_form
from flask_admin._compat import iteritems, string_types
from quartadmin import expose
from quartadmin.babel import gettext, ngettext, lazy_gettext
from quartadmin.model import BaseModelView
from quartadmin.model.form import create_editable_list_form
from quartadmin._compat import iteritems, string_types
import mongoengine
import gridfs
from mongoengine.connection import get_db
from bson.objectid import ObjectId
from flask_admin.actions import action
from quartadmin.actions import action
from .filters import FilterConverter, BaseMongoEngineFilter
from .form import get_form, CustomModelConverter
from .typefmt import DEFAULT_FORMATTERS
@ -52,7 +52,7 @@ class ModelView(BaseModelView):
Collection of the column filters.
Can contain either field names or instances of
:class:`flask_admin.contrib.mongoengine.filters.BaseMongoEngineFilter`
:class:`quartadmin.contrib.mongoengine.filters.BaseMongoEngineFilter`
classes.
Filters will be grouped by name when displayed in the drop-down.
@ -64,14 +64,14 @@ class ModelView(BaseModelView):
or::
from flask_admin.contrib.mongoengine.filters import BooleanEqualFilter
from quartadmin.contrib.mongoengine.filters import BooleanEqualFilter
class MyModelView(BaseModelView):
column_filters = (BooleanEqualFilter(column=User.name, name='Name'),)
or::
from flask_admin.contrib.mongoengine.filters import BaseMongoEngineFilter
from quartadmin.contrib.mongoengine.filters import BaseMongoEngineFilter
class FilterLastNameBrown(BaseMongoEngineFilter):
def apply(self, query, value):
@ -98,7 +98,7 @@ class ModelView(BaseModelView):
field conversion logic.
Custom class should be derived from the
`flask_admin.contrib.mongoengine.form.CustomModelConverter`.
`quartadmin.contrib.mongoengine.form.CustomModelConverter`.
For example::
@ -151,7 +151,7 @@ class ModelView(BaseModelView):
Subdocument configuration options.
This field accepts dictionary, where key is field name and value is either dictionary or instance of the
`flask_admin.contrib.mongoengine.EmbeddedForm`.
`quartadmin.contrib.mongoengine.EmbeddedForm`.
Consider following example::
@ -246,10 +246,10 @@ class ModelView(BaseModelView):
:param menu_icon_type:
Optional icon. Possible icon types:
- `flask_admin.consts.ICON_TYPE_GLYPH` - Bootstrap glyph icon
- `flask_admin.consts.ICON_TYPE_FONT_AWESOME` - Font Awesome icon
- `flask_admin.consts.ICON_TYPE_IMAGE` - Image relative to Flask static directory
- `flask_admin.consts.ICON_TYPE_IMAGE_URL` - Image with full URL
- `quartadmin.consts.ICON_TYPE_GLYPH` - Bootstrap glyph icon
- `quartadmin.consts.ICON_TYPE_FONT_AWESOME` - Font Awesome icon
- `quartadmin.consts.ICON_TYPE_IMAGE` - Image relative to Flask static directory
- `quartadmin.consts.ICON_TYPE_IMAGE_URL` - Image with full URL
:param menu_icon_value:
Icon glyph name or URL, depending on `menu_icon_type` setting

4
flask_admin/contrib/mongoengine/widgets.py → quartadmin/contrib/mongoengine/widgets.py

@ -4,8 +4,8 @@ from markupsafe import escape
from mongoengine.fields import GridFSProxy, ImageGridFsProxy
from flask_admin._backwards import Markup
from flask_admin.helpers import get_url
from quartadmin._backwards import Markup
from quartadmin.helpers import get_url
from . import helpers

0
flask_admin/contrib/peewee/__init__.py → quartadmin/contrib/peewee/__init__.py

4
flask_admin/contrib/peewee/ajax.py → quartadmin/contrib/peewee/ajax.py

@ -1,5 +1,5 @@
from flask_admin._compat import as_unicode, string_types
from flask_admin.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE
from quartadmin._compat import as_unicode, string_types
from quartadmin.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE
from .tools import get_primary_key

4
flask_admin/contrib/peewee/filters.py → quartadmin/contrib/peewee/filters.py

@ -1,6 +1,6 @@
from flask_admin.babel import lazy_gettext
from quartadmin.babel import lazy_gettext
from flask_admin.model import filters
from quartadmin.model import filters
from .tools import parse_like_term

8
flask_admin/contrib/peewee/form.py → quartadmin/contrib/peewee/form.py

@ -10,10 +10,10 @@ except ImportError:
from wtfpeewee.orm import ModelConverter, model_form
from flask_admin import form
from flask_admin._compat import iteritems, itervalues
from flask_admin.model.form import InlineFormAdmin, InlineModelConverterBase
from flask_admin.model.fields import InlineModelFormField, InlineFieldList, AjaxSelectField
from quartadmin import form
from quartadmin._compat import iteritems, itervalues
from quartadmin.model.form import InlineFormAdmin, InlineModelConverterBase
from quartadmin.model.fields import InlineModelFormField, InlineFieldList, AjaxSelectField
from .tools import get_primary_key, get_meta_fields
from .ajax import create_ajax_loader

0
flask_admin/contrib/peewee/tools.py → quartadmin/contrib/peewee/tools.py

20
flask_admin/contrib/peewee/view.py → quartadmin/contrib/peewee/view.py

@ -2,15 +2,15 @@ import logging
from flask import flash
from flask_admin._compat import string_types
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.model import BaseModelView
from flask_admin.model.form import create_editable_list_form
from quartadmin._compat import string_types
from quartadmin.babel import gettext, ngettext, lazy_gettext
from quartadmin.model import BaseModelView
from quartadmin.model.form import create_editable_list_form
from peewee import JOIN, PrimaryKeyField, ForeignKeyField, Field, CharField, TextField
from flask_admin.actions import action
from flask_admin.contrib.peewee import filters
from quartadmin.actions import action
from quartadmin.contrib.peewee import filters
from .form import get_form, CustomModelConverter, InlineModelConverter, save_inline
from .tools import get_meta_fields, get_primary_key, parse_like_term
@ -26,7 +26,7 @@ class ModelView(BaseModelView):
Collection of the column filters.
Can contain either field names or instances of
:class:`flask_admin.contrib.peewee.filters.BasePeeweeFilter` classes.
:class:`quartadmin.contrib.peewee.filters.BasePeeweeFilter` classes.
Filters will be grouped by name when displayed in the drop-down.
@ -37,14 +37,14 @@ class ModelView(BaseModelView):
or::
from flask_admin.contrib.peewee.filters import BooleanEqualFilter
from quartadmin.contrib.peewee.filters import BooleanEqualFilter
class MyModelView(BaseModelView):
column_filters = (BooleanEqualFilter(column=User.name, name='Name'),)
or::
from flask_admin.contrib.peewee.filters import BasePeeweeFilter
from quartadmin.contrib.peewee.filters import BasePeeweeFilter
class FilterLastNameBrown(BasePeeweeFilter):
def apply(self, query, value):
@ -130,7 +130,7 @@ class ModelView(BaseModelView):
3. Django-like ``InlineFormAdmin`` class instance::
from flask_admin.model.form import InlineFormAdmin
from quartadmin.model.form import InlineFormAdmin
class MyInlineModelForm(InlineFormAdmin):
form_columns = ('title', 'date')

13
quartadmin/contrib/peeweemodel/__init__.py

@ -0,0 +1,13 @@
def setup():
import warnings
warnings.warn('Flask-Admin peewee integration module was renamed as '
'quartadmin.contrib.peewee, please use it instead.')
from quartadmin._backwards import import_redirect
import_redirect(__name__, 'quartadmin.contrib.peewee')
setup()
del setup
from ..peewee.view import ModelView # noqa: F401

0
flask_admin/contrib/pymongo/__init__.py → quartadmin/contrib/pymongo/__init__.py

4
flask_admin/contrib/pymongo/filters.py → quartadmin/contrib/pymongo/filters.py

@ -1,7 +1,7 @@
import re
from flask_admin.babel import lazy_gettext
from flask_admin.model import filters
from quartadmin.babel import lazy_gettext
from quartadmin.model import filters
from .tools import parse_like_term

0
flask_admin/contrib/pymongo/tools.py → quartadmin/contrib/pymongo/tools.py

0
flask_admin/contrib/pymongo/typefmt.py → quartadmin/contrib/pymongo/typefmt.py

24
flask_admin/contrib/pymongo/view.py → quartadmin/contrib/pymongo/view.py

@ -6,11 +6,11 @@ from bson.errors import InvalidId
from flask import flash
from flask_admin._compat import string_types
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.model import BaseModelView
from flask_admin.actions import action
from flask_admin.helpers import get_form_data
from quartadmin._compat import string_types
from quartadmin.babel import gettext, ngettext, lazy_gettext
from quartadmin.model import BaseModelView
from quartadmin.actions import action
from quartadmin.helpers import get_form_data
from .filters import BasePyMongoFilter
from .tools import parse_like_term
@ -29,20 +29,20 @@ class ModelView(BaseModelView):
Collection of the column filters.
Should contain instances of
:class:`flask_admin.contrib.pymongo.filters.BasePyMongoFilter` classes.
:class:`quartadmin.contrib.pymongo.filters.BasePyMongoFilter` classes.
Filters will be grouped by name when displayed in the drop-down.
For example::
from flask_admin.contrib.pymongo.filters import BooleanEqualFilter
from quartadmin.contrib.pymongo.filters import BooleanEqualFilter
class MyModelView(BaseModelView):
column_filters = (BooleanEqualFilter(column=User.name, name='Name'),)
or::
from flask_admin.contrib.pymongo.filters import BasePyMongoFilter
from quartadmin.contrib.pymongo.filters import BasePyMongoFilter
class FilterLastNameBrown(BasePyMongoFilter):
def apply(self, query, value):
@ -84,10 +84,10 @@ class ModelView(BaseModelView):
:param menu_icon_type:
Optional icon. Possible icon types:
- `flask_admin.consts.ICON_TYPE_GLYPH` - Bootstrap glyph icon
- `flask_admin.consts.ICON_TYPE_FONT_AWESOME` - Font Awesome icon
- `flask_admin.consts.ICON_TYPE_IMAGE` - Image relative to Flask static directory
- `flask_admin.consts.ICON_TYPE_IMAGE_URL` - Image with full URL
- `quartadmin.consts.ICON_TYPE_GLYPH` - Bootstrap glyph icon
- `quartadmin.consts.ICON_TYPE_FONT_AWESOME` - Font Awesome icon
- `quartadmin.consts.ICON_TYPE_IMAGE` - Image relative to Flask static directory
- `quartadmin.consts.ICON_TYPE_IMAGE_URL` - Image with full URL
:param menu_icon_value:
Icon glyph name or URL, depending on `menu_icon_type` setting
"""

4
flask_admin/contrib/rediscli.py → quartadmin/contrib/rediscli.py

@ -5,8 +5,8 @@ from flask import request
from markupsafe import Markup
from flask_admin.base import BaseView, expose
from flask_admin.babel import gettext
from quartadmin.base import BaseView, expose
from quartadmin.babel import gettext
# Set up logger

0
flask_admin/contrib/sqla/__init__.py → quartadmin/contrib/sqla/__init__.py

4
flask_admin/contrib/sqla/ajax.py → quartadmin/contrib/sqla/ajax.py

@ -1,8 +1,8 @@
from sqlalchemy import or_, and_, cast, text
from sqlalchemy.types import String
from flask_admin._compat import as_unicode, string_types
from flask_admin.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE
from quartadmin._compat import as_unicode, string_types
from quartadmin.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE
from .tools import get_primary_key, has_multiple_pks, is_relationship, is_association_proxy

10
flask_admin/contrib/sqla/fields.py → quartadmin/contrib/sqla/fields.py

@ -12,11 +12,11 @@ except ImportError:
from wtforms.utils import unset_value
from .tools import get_primary_key
from flask_admin._compat import text_type, string_types, iteritems
from flask_admin.contrib.sqla.widgets import CheckboxListInput
from flask_admin.form import FormOpts, BaseForm, Select2Widget
from flask_admin.model.fields import InlineFieldList, InlineModelFormField
from flask_admin.babel import lazy_gettext
from quartadmin._compat import text_type, string_types, iteritems
from quartadmin.contrib.sqla.widgets import CheckboxListInput
from quartadmin.form import FormOpts, BaseForm, Select2Widget
from quartadmin.model.fields import InlineFieldList, InlineModelFormField
from quartadmin.babel import lazy_gettext
try:
from sqlalchemy.orm.util import identity_key

6
flask_admin/contrib/sqla/filters.py → quartadmin/contrib/sqla/filters.py

@ -1,6 +1,6 @@
from flask_admin.babel import lazy_gettext
from flask_admin.model import filters
from flask_admin.contrib.sqla import tools
from quartadmin.babel import lazy_gettext
from quartadmin.model import filters
from quartadmin.contrib.sqla import tools
from sqlalchemy.sql import not_, or_
import enum

14
flask_admin/contrib/sqla/form.py → quartadmin/contrib/sqla/form.py

@ -5,19 +5,19 @@ from wtforms import fields, validators
from sqlalchemy import Boolean, Column
from sqlalchemy.orm import ColumnProperty
from flask_admin import form
from flask_admin.model.form import (converts, ModelConverterBase,
from quartadmin import form
from quartadmin.model.form import (converts, ModelConverterBase,
InlineModelConverterBase, FieldPlaceholder)
from flask_admin.model.fields import AjaxSelectField, AjaxSelectMultipleField
from flask_admin.model.helpers import prettify_name
from flask_admin._backwards import get_property
from flask_admin._compat import iteritems, text_type
from quartadmin.model.fields import AjaxSelectField, AjaxSelectMultipleField
from quartadmin.model.helpers import prettify_name
from quartadmin._backwards import get_property
from quartadmin._compat import iteritems, text_type
from .validators import Unique, valid_currency, valid_color, TimeZoneValidator
from .fields import (QuerySelectField, QuerySelectMultipleField,
InlineModelFormList, InlineHstoreList, HstoreForm,
InlineModelOneToOneField)
from flask_admin.model.fields import InlineFormField
from quartadmin.model.fields import InlineFormField
from .tools import (has_multiple_pks, filter_foreign_columns,
get_field_with_path, is_association_proxy, is_relationship)
from .ajax import create_ajax_loader

4
flask_admin/contrib/sqla/tools.py → quartadmin/contrib/sqla/tools.py

@ -13,8 +13,8 @@ from sqlalchemy.sql.operators import eq
from sqlalchemy.exc import DBAPIError
from sqlalchemy.orm.attributes import InstrumentedAttribute
from flask_admin._compat import filter_list, string_types
from flask_admin.tools import iterencode, iterdecode, escape # noqa: F401
from quartadmin._compat import filter_list, string_types
from quartadmin.tools import iterencode, iterdecode, escape # noqa: F401
def parse_like_term(term):

2
flask_admin/contrib/sqla/typefmt.py → quartadmin/contrib/sqla/typefmt.py

@ -1,6 +1,6 @@
from sqlalchemy.ext.associationproxy import _AssociationList
from flask_admin.model.typefmt import BASE_FORMATTERS, EXPORT_FORMATTERS, \
from quartadmin.model.typefmt import BASE_FORMATTERS, EXPORT_FORMATTERS, \
list_formatter
from sqlalchemy.orm.collections import InstrumentedList

2
flask_admin/contrib/sqla/validators.py → quartadmin/contrib/sqla/validators.py

@ -6,7 +6,7 @@ try:
except ImportError:
from wtforms.validators import Required as InputRequired
from flask_admin._compat import filter_list
from quartadmin._compat import filter_list
class Unique(object):

36
flask_admin/contrib/sqla/view.py → quartadmin/contrib/sqla/view.py

@ -13,15 +13,15 @@ from sqlalchemy import Unicode
from flask import current_app, flash
from flask_admin._compat import string_types, text_type
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.contrib.sqla.tools import is_relationship
from flask_admin.model import BaseModelView
from flask_admin.model.form import create_editable_list_form
from flask_admin.actions import action
from flask_admin._backwards import ObsoleteAttr
from flask_admin.contrib.sqla import form, filters as sqla_filters, tools
from quartadmin._compat import string_types, text_type
from quartadmin.babel import gettext, ngettext, lazy_gettext
from quartadmin.contrib.sqla.tools import is_relationship
from quartadmin.model import BaseModelView
from quartadmin.model.form import create_editable_list_form
from quartadmin.actions import action
from quartadmin._backwards import ObsoleteAttr
from quartadmin.contrib.sqla import form, filters as sqla_filters, tools
from .typefmt import DEFAULT_FORMATTERS
from .ajax import create_ajax_loader
@ -117,7 +117,7 @@ class ModelView(BaseModelView):
Collection of the column filters.
Can contain either field names or instances of
:class:`flask_admin.contrib.sqla.filters.BaseSQLAFilter` classes.
:class:`quartadmin.contrib.sqla.filters.BaseSQLAFilter` classes.
Filters will be grouped by name when displayed in the drop-down.
@ -128,14 +128,14 @@ class ModelView(BaseModelView):
or::
from flask_admin.contrib.sqla.filters import BooleanEqualFilter
from quartadmin.contrib.sqla.filters import BooleanEqualFilter
class MyModelView(BaseModelView):
column_filters = (BooleanEqualFilter(column=User.name, name='Name'),)
or::
from flask_admin.contrib.sqla.filters import BaseSQLAFilter
from quartadmin.contrib.sqla.filters import BaseSQLAFilter
class FilterLastNameBrown(BaseSQLAFilter):
def apply(self, query, value, alias=None):
@ -220,7 +220,7 @@ class ModelView(BaseModelView):
3. Django-like ``InlineFormAdmin`` class instance::
from flask_admin.model.form import InlineFormAdmin
from quartadmin.model.form import InlineFormAdmin
class MyInlineModelForm(InlineFormAdmin):
form_columns = ('title', 'date')
@ -253,7 +253,7 @@ class ModelView(BaseModelView):
To achieve this, you need to install special ``inline_converter``
for your model::
from flask_admin.contrib.sqla.form import \
from quartadmin.contrib.sqla.form import \
InlineOneToOneModelConverter
class MyInlineModelForm(InlineFormAdmin):
@ -321,10 +321,10 @@ class ModelView(BaseModelView):
:param menu_icon_type:
Optional icon. Possible icon types:
- `flask_admin.consts.ICON_TYPE_GLYPH` - Bootstrap glyph icon
- `flask_admin.consts.ICON_TYPE_FONT_AWESOME` - Font Awesome icon
- `flask_admin.consts.ICON_TYPE_IMAGE` - Image relative to Flask static directory
- `flask_admin.consts.ICON_TYPE_IMAGE_URL` - Image with full URL
- `quartadmin.consts.ICON_TYPE_GLYPH` - Bootstrap glyph icon
- `quartadmin.consts.ICON_TYPE_FONT_AWESOME` - Font Awesome icon
- `quartadmin.consts.ICON_TYPE_IMAGE` - Image relative to Flask static directory
- `quartadmin.consts.ICON_TYPE_IMAGE_URL` - Image with full URL
:param menu_icon_value:
Icon glyph name or URL, depending on `menu_icon_type` setting
"""

2
flask_admin/contrib/sqla/widgets.py → quartadmin/contrib/sqla/widgets.py

@ -1,6 +1,6 @@
from wtforms.widgets.core import escape
from flask_admin._backwards import Markup
from quartadmin._backwards import Markup
class CheckboxListInput:

13
quartadmin/contrib/sqlamodel/__init__.py

@ -0,0 +1,13 @@
def setup():
import warnings
warnings.warn('Flask-Admin sqlalchemy integration module was renamed as '
'quartadmin.contrib.sqla, please use it instead.')
from quartadmin._backwards import import_redirect
import_redirect(__name__, 'quartadmin.contrib.sqla')
setup()
del setup
from ..sqla.view import ModelView # noqa: F401

4
flask_admin/form/__init__.py → quartadmin/form/__init__.py

@ -1,6 +1,6 @@
from wtforms import form, __version__ as wtforms_version
from wtforms.fields.core import UnboundField
from flask_admin.babel import Translations
from quartadmin.babel import Translations
from .fields import * # noqa: F403,F401
from .widgets import * # noqa: F403,F401
@ -45,7 +45,7 @@ if int(wtforms_version[0]) > 1:
from os import urandom
from flask import session, current_app
from wtforms.csrf.session import SessionCSRF
from flask_admin._compat import text_type
from quartadmin._compat import text_type
class SecureForm(BaseForm):
"""

4
flask_admin/form/fields.py → quartadmin/form/fields.py

@ -3,8 +3,8 @@ import datetime
import json
from wtforms import fields
from flask_admin.babel import gettext
from flask_admin._compat import text_type, as_unicode
from quartadmin.babel import gettext
from quartadmin._compat import text_type, as_unicode
from . import widgets as admin_widgets

4
flask_admin/form/rules.py → quartadmin/form/rules.py

@ -1,7 +1,7 @@
from markupsafe import Markup
from flask_admin._compat import string_types
from flask_admin import helpers
from quartadmin._compat import string_types
from quartadmin import helpers
class BaseRule(object):

8
flask_admin/form/upload.py → quartadmin/form/upload.py

@ -12,11 +12,11 @@ try:
except ImportError:
from wtforms.utils import unset_value
from flask_admin.babel import gettext
from flask_admin.helpers import get_url
from quartadmin.babel import gettext
from quartadmin.helpers import get_url
from flask_admin._backwards import Markup
from flask_admin._compat import string_types, urljoin
from quartadmin._backwards import Markup
from quartadmin._compat import string_types, urljoin
try:

2
flask_admin/form/validators.py → quartadmin/form/validators.py

@ -1,4 +1,4 @@
from flask_admin.babel import gettext
from quartadmin.babel import gettext
from wtforms.validators import StopValidation

4
flask_admin/form/widgets.py → quartadmin/form/widgets.py

@ -1,7 +1,7 @@
from wtforms import widgets
from flask import current_app
from flask_admin.babel import gettext, ngettext
from flask_admin import helpers as h
from quartadmin.babel import gettext, ngettext
from quartadmin import helpers as h
__all__ = ['Select2Widget', 'DatePickerWidget', 'DateTimePickerWidget', 'RenderTemplateWidget', 'Select2TagsWidget', ]

6
flask_admin/helpers.py → quartadmin/helpers.py

@ -2,7 +2,7 @@ from re import sub, compile