### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- admin »
- action »

# list_action

class `camelot.admin.action.list_action.``CallMethod`(verbose_name, method, enabled=None)

  Call a method on all objects in a selection, and flush the session.

  Parameters: | verbose_name – the name of the action, as it should appear to the user method – the method to call on the objects enabled – method to call on objects to verify if the action is enabled, by default the action is always enabled

  This action can be used either within `list_actions` or within `form_actions`.

class `camelot.admin.action.list_action.``DeleteSelection`

  Delete the selected rows in a table

class `camelot.admin.action.list_action.``DuplicateSelection`

  Duplicate the selected rows in a table

class `camelot.admin.action.list_action.``ExportDocument`

  Export all rows in a table to a word document

class `camelot.admin.action.list_action.``ExportSpreadsheet`

  Export all rows in a table to a spreadsheet

class `camelot.admin.action.list_action.``ListActionGuiContext`

  The context for an `Action` on a table view. On top of the attributes of the `camelot.admin.action.application_action.ApplicationActionGuiContext`, this context contains :

  `item_view`

    the `QtGui.QAbstractItemView` class that relates to the table view on which the widget will be placed.

  `model_context`

    alias of `ListActionModelContext`

class `camelot.admin.action.list_action.``ListActionModelContext`

  On top of the attributes of the `camelot.admin.action.application_action.ApplicationActionModelContext`, this context contains :

  `selection_count`

    the number of selected rows.

  `collection_count`

    the number of rows in the list.

  `selected_rows`

    an ordered list with tuples of selected row ranges. the range is inclusive.

  `current_row`

    the current row in the list

  `session`

    The session to which the objects in the list belong.

  The `collection_count` and `selection_count` attributes allow the `model_run()` to quickly evaluate the size of the collection or the selection without calling the potentially time consuming methods `get_collection()` and `get_selection()`.

  `get_collection`(yield_per=None)

    Parameters: | yield_per – an integer number giving a hint on how many objects should fetched from the database at the same time.
    Returns: | a generator over the objects in the list

  `get_object`()

    Returns: | the object displayed in the current row or None

  `get_selection`(yield_per=None)

    Parameters: | yield_per – an integer number giving a hint on how many objects should fetched from the database at the same time.
    Returns: | a generator over the objects selected

class `camelot.admin.action.list_action.``OpenFormView`

  Open a form view for the current row of a list.

class `camelot.admin.action.list_action.``PrintPreview`

  Print all rows in a table

class `camelot.admin.action.list_action.``SendEmail`

  Send all rows in a table by mail

class `camelot.admin.action.list_action.``ToFirstRow`

  Move to the first row in a table

class `camelot.admin.action.list_action.``ToLastRow`

  Move to the last row in a table

class `camelot.admin.action.list_action.``ToNextRow`

  Move to the next row in a table

class `camelot.admin.action.list_action.``ToPreviousRow`

  Move to the previous row in a table

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- admin »
- action »

Comments
blog comments powered by Disqus