Welcome to mf-pyramid’s documentation!

Contents:

class mfpyramid.dashboard.Dashboard[source]

Manage administration dashboard for pyramid

static add_dashboard(klasses, config=None, prefix='')[source]

Adds a list of class to the dashboard

Parameters:
  • klasses (list) – list of object class to add to the dashboard
  • config (pyramid.config.Configurator) – Pyramid Configurator
  • prefix (str) – optional prefix to add in front of the routes
static set_config(config)[source]
Global config for dashboard.
  • permission: Pyramid permission for /admin views, no permission by default
  • templates: path to Mako dashboard template, default is Dashboard.mako
Parameters:config (dict) – configuration dictionary
static set_connection(conn)[source]

Sets the db connection to mongo

Parameters:conn (Connection) – MongoDB connection objects
mfpyramid.views.mf_delete(request)[source]

Delete an object If object has a function “my()”, then the function is called to get a filter on the request

Parameters:request (IMultiDict) – HTTP params
Returns:json - Status fo the operation
mfpyramid.views.mf_edit(request)[source]

Update an object in database

Parameters:request (IMultiDict) – HTTP params
Returns:json - Status of update and updated object
mfpyramid.views.mf_filter(objname, control, request=None)[source]

Return a mongo filter on object. It calls, if exists, the my method of the current object and returns the filter obtained from this method. :param objname: Name of the current object :type objname: str :param control: Type of operation :type control: MF_READ or MF_EDIT :param request: Current request :type request: pyramid.request :return: filter to use (dict)

mfpyramid.views.mf_list(request)[source]

Returns a JSON list of the object defined in the route If object has a function “my()”, then the function is called to get a filter on the request

Parameters:request (IMultiDict) – HTTP params
Returns:json - List of objects

Returns a JSON list of objects matching criteria on object

Returns:json - List of objects
mfpyramid.views.mf_show(request)[source]

Returns a JSON object defined in the route If object has a function “my()”, then the function is called to get a filter on the request

Parameters:request (IMultiDict) – HTTP params
Returns:json - Object from database
mfpyramid.views.pluralize(name)[source]

Pluralize a name :param name: Name of the object :type name: str :return: str - lowercase object name with a final s

Indices and tables