Package Camelot :: Package camelot :: Package admin :: Package list_action :: Class ListActionFromModelFunction
[frames] | no frames]

Class ListActionFromModelFunction

source code


Convert a function that is supposed to run in the model thread to a FormAction
Instance Methods
 
__init__(self, name, model_function, icon=None, collection_flush=False, selection_flush=False)
in the list view. :param collection_flush: flush all objects in the collection to the db and refresh them in the views :param selection_flush: flush all objects in the selection to the db and refresh them in the views
source code
 
run(self, collection_getter, selection_getter)
Overwrite this method to create an action that does something
source code

Inherited from ListAction: render

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables

Inherited from ListAction: Options

Properties

Inherited from object: __class__

Method Details

__init__(self, name, model_function, icon=None, collection_flush=False, selection_flush=False)
(Constructor)

source code 
in the list view. :param collection_flush: flush all objects in the collection to the db and refresh them in the views :param selection_flush: flush all objects in the selection to the db and refresh them in the views
Parameters:
  • model_function - a function that has 2 arguments : the collection in the list view and the selection
Overrides: object.__init__

run(self, collection_getter, selection_getter)

source code 

Overwrite this method to create an action that does something

an object of of type Options

Returns:
None if there was no Options class attribute or if Cancel was pressed, otherwise
Overrides: ListAction.run
(inherited documentation)