8.2.10.4.1.1. Admin¶
- class Admin(app, name='Admin', index_view=None, url=None, endpoint=None, **kwargs)[source]¶
Methods
__delattr__Implement delattr(self, name).
__dir__Default dir() implementation.
__eq__Return self==value.
__format__Default object formatter.
__ge__Return self>=value.
__getattribute__Return getattr(self, name).
__getstate__Helper for pickle.
__gt__Return self>value.
__hash__Return hash(self).
Constructor.
__init_subclass__This method is called when a class is subclassed.
__le__Return self<=value.
__lt__Return self<value.
__ne__Return self!=value.
__new____reduce__Helper for pickle.
__reduce_ex__Helper for pickle.
__repr__Return repr(self).
__setattr__Implement setattr(self, name, value).
__sizeof__Size of object in memory, in bytes.
__str__Return str(self).
__subclasshook__Abstract classes can override this to customize issubclass().
_add_menu_item_add_view_to_menuAdd a view to the menu tree
_init_extension_set_admin_index_viewAdd the admin index view.
_validate_admin_host_and_subdomainadd_categoryAdd a category of a given name
add_linkAdd link to menu links collection.
add_linksAdd one or more links to the menu links collection.
add_menu_itemAdd menu item to menu tree hierarchy.
add_sub_categoryAdd a category of a given name underneath the category with parent_name.
add_viewAdd a view to the collection.
add_viewsAdd one or more views to the collection.
get_category_menu_itemRegister all views with the Flask application.
menuReturn the menu hierarchy.
menu_linksReturn menu links.
- __init__(app, name='Admin', index_view=None, url=None, endpoint=None, **kwargs)[source]¶
Constructor.
- Parameters:
app – Flask application object
name – Application name. Will be displayed in the main menu and as a page title. Defaults to “Admin”
url – Base URL
subdomain – Subdomain to use
index_view – Home page view to use. Defaults to AdminIndexView.
translations_path – Location of the translation message catalogs. By default will use the translations shipped with Flask-Admin.
endpoint – Base endpoint name for index view. If you use multiple instances of the Admin class with a single Flask application, you have to set a unique endpoint name for each instance.
static_url_path – Static URL Path. If provided, this specifies the default path to the static url directory for all its views. Can be overridden in view configuration.
theme – Base theme. Defaults to Bootstrap4Theme().
category_icon_classes – A dict of category names as keys and html classes as values to be added to menu category icons. Example: {‘Favorites’: ‘glyphicon glyphicon-star’}
host – The host to register all admin views on. Mutually exclusive with subdomain
csp_nonce_generator – A callable that returns a nonce to inject into Flask-Admin JS, CSS, etc.
Attributes
__dict____weakref__list of weak references to the object
- __init__(app, name='Admin', index_view=None, url=None, endpoint=None, **kwargs)[source]¶
Constructor.
- Parameters:
app – Flask application object
name – Application name. Will be displayed in the main menu and as a page title. Defaults to “Admin”
url – Base URL
subdomain – Subdomain to use
index_view – Home page view to use. Defaults to AdminIndexView.
translations_path – Location of the translation message catalogs. By default will use the translations shipped with Flask-Admin.
endpoint – Base endpoint name for index view. If you use multiple instances of the Admin class with a single Flask application, you have to set a unique endpoint name for each instance.
static_url_path – Static URL Path. If provided, this specifies the default path to the static url directory for all its views. Can be overridden in view configuration.
theme – Base theme. Defaults to Bootstrap4Theme().
category_icon_classes – A dict of category names as keys and html classes as values to be added to menu category icons. Example: {‘Favorites’: ‘glyphicon glyphicon-star’}
host – The host to register all admin views on. Mutually exclusive with subdomain
csp_nonce_generator – A callable that returns a nonce to inject into Flask-Admin JS, CSS, etc.
- __annotations__ = {'_menu_categories': 'dict[str, MenuCategory]', 'theme': 'Theme'}¶
- __doc__ = None¶
- __module__ = 'schedula.utils.form.server.admin'¶
- theme: Theme¶