ext

Invenio-Admin Flask extension.

class ext._AdminState

State for Invenio-Admin.

__init__(app, admin, permission_factory, view_class_factory)

Initialize state.

Parameters:
  • app – The Flask application.
  • admin – The Flask-Admin application.
  • permission_factory – The permission factory to restrict access.
  • view_class_factory – The view class factory to initialize them.
register_view(view_class, *args, **kwargs)

Register an admin view on this admin instance.

Parameters:
  • view_class – The view class name passed to the view factory.
  • args – Positional arugments for view class.
  • kwargs – Keyword arguments to view class.
load_entry_point_group(entry_point_group)

Load administration interface from entry point group.

Parameters:entry_point_group (str) – Name of the entry point group.
class ext.InvenioAdmin

Invenio-Admin extension.

__init__(app=None, **kwargs)

Invenio-Admin extension initialization.

Parameters:
  • app – The Flask application. (Default: None)
  • kwargs – Passed to init_app().
init_app(app, entry_point_group="invenio_admin.views", permission_factory=None, view_class_factory=protected_adminview_factory, index_view_class=AdminIndexView)

Flask application initialization.

Parameters:
  • app – The Flask application.
  • entry_point_group – Name of entry point group to load views/models from. (Default: 'invenio_admin.views')
  • permission_factory – Default permission factory to use when protecting an admin view. (Default: admin_permission_factory())
  • view_class_factory – Factory for creating admin view classes on the fly. Used to protect admin views with authentication and authorization. (Default: protected_adminview_factory())
  • index_view_class – Specify administrative interface index page. (Default: flask_admin.base.AdminIndexView)
  • kwargs – Passed to flask_admin.base.Admin.
Returns:

Extension state.

init_config()

Initialize configuration.

Parameters:app – The Flask application.
__getattr__(name)

Proxy to state object.

Parameters:name – Attribute name of the state.