PyMongo model backend implementation.
MongoEngine model scaffolding.
Class inherits configuration options from BaseModelView and they’re not displayed here.
Collection of the column filters.
Should contain instances of flask.ext.admin.contrib.pymongo.filters.BasePyMongoFilter classes.
For example:
class MyModelView(BaseModelView):
column_filters = (BooleanEqualFilter(User.name, 'Name'),)
Mass-model action view.
Perform some actions after a model was created or updated and committed to the database.
Called from create_model after successful database commit.
By default does nothing.
Parameters: |
|
---|
Create Flask blueprint.
Instantiate model creation form and return it.
Override to implement custom behavior.
Create model helper
Parameters: | form – Form instance |
---|
Create model view
Delete model helper
Parameters: | model – Model instance |
---|
Delete model view. Only POST method is allowed.
Create edit form from the MongoDB document
Edit model view
Return a list and a dictionary of allowed actions.
Return a human-readable column name.
Parameters: | field – Model field name. |
---|
Create form class for model creation view.
Override to implement customized behavior.
Create form class for model editing view.
Override to implement customized behavior.
Given a filter flt, return a unique name for that filter in this view.
Does not include the flt[n]_ portion of the filter name.
Parameters: |
|
---|
Return a list of filter objects.
If your model backend implementation does not support filters, override this method and return None.
Get form class.
If self.form is set, will return it and will call self.scaffold_form otherwise.
Override to implement customized behavior.
Get list of objects from MongoEngine
Parameters: |
|
---|
Returns a list of the model field names. If column_list was set, returns it. Otherwise calls scaffold_list_columns to generate the list from the model.
Returns the value to be displayed in the list view
Parameters: |
|
---|
Return single model instance by ID
Parameters: | id – Model ID |
---|
Return primary key value from the model instance
Parameters: | model – Model instance |
---|
Returns a dictionary of the sortable columns. Key is a model field name and value is sort column (for example - attribute).
If column_sortable_list is set, will use it. Otherwise, will call scaffold_sortable_columns to get them from the model.
Handle action request.
Parameters: | return_view – Name of the view to return to after the request. If not provided, will return user to the index view. |
---|
List view
Initialize list of actions for the current administrative view.
Init search
Override this method to add permission checks.
Flask-Admin does not make any assumptions about the authentication system used in your application, so it is up to you to implement it.
By default, it will allow access for everyone.
Verify if column is sortable.
Parameters: | name – Column name. |
---|
Validate if it is valid MongoEngine filter
Parameters: | filter – Filter object |
---|
Override this method if you want dynamically hide or show administrative views from Flask-Admin menu structure
By default, item is visible in menu.
Please note that item should be both visible and accessible to be displayed in menu.
Perform some actions after a model is created or updated.
Called from create_model and update_model in the same transaction (if it has any meaning for a store backend).
By default does nothing.
Parameters: |
|
---|
Perform some actions before a model is deleted.
Called from delete_model in the same transaction (if it has any meaning for a store backend).
By default do nothing.
Render template
Parameters: |
|
---|
Return filter object(s) for the field
Parameters: | name – Either field name or field instance |
---|
Scaffold list columns
Return sortable columns dictionary (name, field)
Update model helper
Parameters: |
|
---|