list_action

class camelot.admin.action.list_action.AddExistingObject[source]

Add an existing object to a list if it is not yet in the list

class camelot.admin.action.list_action.AddNewObject[source]

Add a new object to a collection. Depending on the ‘create_inline’ field attribute, a new form is opened or not

class camelot.admin.action.list_action.CallMethod(verbose_name, method, enabled=None)[source]

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[source]

Delete the selected rows in a table

class camelot.admin.action.list_action.DuplicateSelection[source]

Duplicate the selected rows in a table

class camelot.admin.action.list_action.EditAction[source]

A base class for an action that will modify the model, it will be disabled when the field_attributes for the relation field are set to not-editable.

class camelot.admin.action.list_action.ExportSpreadsheet[source]

Export all rows in a table to a spreadsheet

class camelot.admin.action.list_action.ImportFromFile[source]

Import a csv file in the current table

class camelot.admin.action.list_action.ListActionGuiContext[source]

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.

view

a camelot.view.controls.view.AbstractView class that represents the view in which the action is triggered.

field_attributes

a dictionary with the field attributes of the list. This dictionary will be filled in case if the list displayed is related to a field on another object. For example, the list of addresses of Person will have the field attributes of the Person.addresses field when displayed on the Person form.

model_context

alias of ListActionModelContext

class camelot.admin.action.list_action.ListActionModelContext[source]

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.

field_attributes

The field attributes of the field to which the list relates, for example the attributes of Person.addresses if the list is the list of addresses of the Person.

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)[source]
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()[source]
Returns:the object displayed in the current row or None
get_selection(yield_per=None)[source]
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.ListContextAction[source]

An base class for actions that should only be enabled if the gui_context is a ListActionModelContext

class camelot.admin.action.list_action.OpenFormView[source]

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

class camelot.admin.action.list_action.OpenNewView[source]

Opens a new view of an Entity related to a table view.

class camelot.admin.action.list_action.PrintPreview[source]

Print all rows in a table

class camelot.admin.action.list_action.RemoveSelection[source]

Remove the selected objects from a list without deleting them

class camelot.admin.action.list_action.ReplaceFieldContents[source]

Select a field an change the content for a whole selection

class camelot.admin.action.list_action.SelectAll[source]

Select all rows in a table

class camelot.admin.action.list_action.ToFirstRow[source]

Move to the first row in a table

class camelot.admin.action.list_action.ToLastRow[source]

Move to the last row in a table

class camelot.admin.action.list_action.ToNextRow[source]

Move to the next row in a table

class camelot.admin.action.list_action.ToPreviousRow[source]

Move to the previous row in a table

Previous topic

form_action

Next topic

application_admin

This Page