geonature.core.gn_permissions.admin
Module Contents
Classes
Base SQLAlchemy filter. |
|
Base SQLAlchemy filter. |
|
Base SQLAlchemy filter. |
|
Base SQLAlchemy filter. |
|
Base SQLAlchemy filter. |
|
Select2 styled select widget. |
|
Overrides the QuerySelectField class from flask admin to allow |
|
Ajax related model loader. Override this to implement custom loading behavior. |
|
SQLAlchemy model view |
|
SQLAlchemy model view |
|
SQLAlchemy model view |
|
SQLAlchemy model view |
|
SQLAlchemy model view |
|
SQLAlchemy model view |
Functions
|
|
|
|
|
|
|
|
|
|
|
- class geonature.core.gn_permissions.admin.RoleFilter(column, name, options=None, data_type=None)[source]
Bases:
geonature.core.admin.utils.DynamicOptionsMixin
,flask_admin.contrib.sqla.filters.FilterEqual
Base SQLAlchemy filter.
- class geonature.core.gn_permissions.admin.ModuleFilter(column, name, options=None, data_type=None)[source]
Bases:
geonature.core.admin.utils.DynamicOptionsMixin
,flask_admin.contrib.sqla.filters.FilterEqual
Base SQLAlchemy filter.
- class geonature.core.gn_permissions.admin.ObjectFilter(column, name, options=None, data_type=None)[source]
Bases:
geonature.core.admin.utils.DynamicOptionsMixin
,flask_admin.contrib.sqla.filters.FilterEqual
Base SQLAlchemy filter.
- class geonature.core.gn_permissions.admin.ActionFilter(column, name, options=None, data_type=None)[source]
Bases:
geonature.core.admin.utils.DynamicOptionsMixin
,flask_admin.contrib.sqla.filters.FilterEqual
Base SQLAlchemy filter.
- class geonature.core.gn_permissions.admin.ScopeFilter(column, name, options=None, data_type=None)[source]
Bases:
geonature.core.admin.utils.DynamicOptionsMixin
,flask_admin.contrib.sqla.filters.FilterEqual
Base SQLAlchemy filter.
- geonature.core.gn_permissions.admin.permissions_count_formatter(view, context, model, name)[source]
- class geonature.core.gn_permissions.admin.OptionSelect2Widget(multiple=False)[source]
Bases:
flask_admin.form.widgets.Select2Widget
Select2 styled select widget.
You must include select2.js, form-x.x.x.js and select2 stylesheet for it to work.
- class geonature.core.gn_permissions.admin.OptionQuerySelectField(*args, **kwargs)[source]
Bases:
flask_admin.contrib.sqla.fields.QuerySelectField
Overrides the QuerySelectField class from flask admin to allow other attributes on a select option.
options_additional_values is added in form_args, it is a list of strings, each element is the name of the attribute in the model which will be added on the option
- class geonature.core.gn_permissions.admin.UserAjaxModelLoader(name, session, model, **options)[source]
Bases:
flask_admin.contrib.sqla.ajax.QueryAjaxModelLoader
Ajax related model loader. Override this to implement custom loading behavior.
- class geonature.core.gn_permissions.admin.ObjectAdmin(model, session, name=None, category=None, endpoint=None, url=None, static_folder=None, menu_class_name=None, menu_icon_type=None, menu_icon_value=None)[source]
Bases:
geonature.core.admin.utils.CruvedProtectedMixin
,flask_admin.contrib.sqla.ModelView
SQLAlchemy model view
Usage sample:
admin = Admin() admin.add_view(ModelView(User, db.session))
- class geonature.core.gn_permissions.admin.PermissionAdmin(model, session, name=None, category=None, endpoint=None, url=None, static_folder=None, menu_class_name=None, menu_icon_type=None, menu_icon_value=None)[source]
Bases:
geonature.core.admin.utils.CruvedProtectedMixin
,flask_admin.contrib.sqla.ModelView
SQLAlchemy model view
Usage sample:
admin = Admin() admin.add_view(ModelView(User, db.session))
- column_sortable_list = (('role', 'role.nom_complet'), ('module', 'module.module_code'), ('object',...[source]
- column_default_sort = [('role.nom_complet', False), ('module.module_code', False), ('object.code_object', False),...[source]
- class geonature.core.gn_permissions.admin.PermissionAvailableAdmin(model, session, name=None, category=None, endpoint=None, url=None, static_folder=None, menu_class_name=None, menu_icon_type=None, menu_icon_value=None)[source]
Bases:
geonature.core.admin.utils.CruvedProtectedMixin
,flask_admin.contrib.sqla.ModelView
SQLAlchemy model view
Usage sample:
admin = Admin() admin.add_view(ModelView(User, db.session))
- column_sortable_list = (('module', 'module.module_code'), ('object', 'object.code_object'), ('action', 'action.code_action'))[source]
- class geonature.core.gn_permissions.admin.RolePermAdmin(model, session, name=None, category=None, endpoint=None, url=None, static_folder=None, menu_class_name=None, menu_icon_type=None, menu_icon_value=None)[source]
Bases:
geonature.core.admin.utils.CruvedProtectedMixin
,flask_admin.contrib.sqla.ModelView
SQLAlchemy model view
Usage sample:
admin = Admin() admin.add_view(ModelView(User, db.session))
- class geonature.core.gn_permissions.admin.GroupPermAdmin(model, session, name=None, category=None, endpoint=None, url=None, static_folder=None, menu_class_name=None, menu_icon_type=None, menu_icon_value=None)[source]
Bases:
RolePermAdmin
SQLAlchemy model view
Usage sample:
admin = Admin() admin.add_view(ModelView(User, db.session))
- get_query()[source]
Return a query for the model type.
This method can be used to set a « persistent filter » on an index_view.
Example:
class MyView(ModelView): def get_query(self): return super(MyView, self).get_query().filter(User.username == current_user.username)
If you override this method, don’t forget to also override get_count_query, for displaying the correct item count in the list view, and get_one, which is used when retrieving records for the edit view.
- class geonature.core.gn_permissions.admin.UserPermAdmin(model, session, name=None, category=None, endpoint=None, url=None, static_folder=None, menu_class_name=None, menu_icon_type=None, menu_icon_value=None)[source]
Bases:
RolePermAdmin
SQLAlchemy model view
Usage sample:
admin = Admin() admin.add_view(ModelView(User, db.session))
- column_details_list = ('identifiant', 'nom_role', 'prenom_role', 'groups', 'permissions_count', 'permissions')[source]
- get_query()[source]
Return a query for the model type.
This method can be used to set a « persistent filter » on an index_view.
Example:
class MyView(ModelView): def get_query(self): return super(MyView, self).get_query().filter(User.username == current_user.username)
If you override this method, don’t forget to also override get_count_query, for displaying the correct item count in the list view, and get_one, which is used when retrieving records for the edit view.