camelot.camelot.view.elixir_admin.EntityAdmin

Package camelot :: Package camelot :: Package view :: Module elixir_admin :: Class EntityAdmin |
[hide private]
[frames] | no frames]

# Class EntityAdmin

source code

Instance Methods | [hide private]
__init__(self, app_admin, entity) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code
__str__(self) str(x) | source code
getName(self) | source code
getModelThread(self) | source code
getFormActions(self, entity) | source code
getRelatedEntityAdmin(self, entity) Get the related admin class for an entity, optionally specify for which field of this admin's entity | source code
getSubclasses(self) Return admin objects for the subclasses of the Entity represented by this admin object | source code
getFieldAttributes(self, field_name) Get the attributes needed to visualize the field field_name @param field_name : the name of the field @return: a dictionary of attributes needed to visualize the field, those attributes can be: * python_type : the corresponding python type of the object * editable : bool specifying wether the user can edit this field * widget : which widget to be used to render the field * ... | source code
getColumns(self) The columns to be displayed in the list view, returns a list of pairs of the name of the field and its attributes needed to display it properly | source code
getFields(self) | source code
getForm(self) | source code
getListCharts(self) | source code
getFilters(self) Return the filters applicable for these entities each filter is | source code
createValidator(self, model) | source code
setDefaults(self, entity_instance) Set the defaults of an object | source code
createNewView(admin, parent=None, oncreate=None, onexpunge=None) Create a QT widget containing a form to create a new instance of the entity related to this admin class | source code
createFormView(admin, title, model, index, parent) Creates a Qt widget containing a form view, for a specific row of the passed query; uses the Admin class | source code
createSelectView(admin, query, search_text=None, parent=None) Returns a QT widget that can be used to select an element from a query, | source code
createTableView(self, query, parent=None) Returns a QT widget containing a table view, for a certain query, using this Admin class; the table widget contains a model QueryTableModel | source code
Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`

Class Variables | [hide private]
| name = `None`
| list_display = `[]`
| fields = `[]`
| form = `[]`
| form_display = `[]`
| list_filter = `[]`
| list_charts = `[]`
| list_actions = `[]`
| list_size = `700, 500`
| form_size = `700, 500`
| form_actions = `[]`
| form_title_column = `None`
| field_attributes = `{}`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, app_admin, entity) (Constructor) | source code
x.__init__(...) initializes x; see x.__class__.__doc__ for signature Parameters: `app_admin` - the application admin object for this application `entity` - the entity class for which this admin instance is to be used Overrides: object.__init__

### __str__(self) (Informal representation operator) | source code
str(x) Overrides: object.__str__ (inherited documentation)

### getFormActions(self, entity) | source code
Decorators: `@model_function`

### getSubclasses(self) | source code
Return admin objects for the subclasses of the Entity represented by this admin object Decorators: `@model_function`

### getFieldAttributes(self, field_name) | source code
    Get the attributes needed to visualize the field field_name
    @param field_name : the name of the field
    @return: a dictionary of attributes needed to visualize the field, those
    attributes can be:
     * python_type : the corresponding python type of the object
     * editable : bool specifying wether the user can edit this field
     * widget : which widget to be used to render the field
     * ...
Decorators: `@model_function`

### getColumns(self) | source code
    The columns to be displayed in the list view, returns a list of pairs of
    the name of the field and its attributes needed to display it properly

    @return: [(field_name,
              {'widget': widget_type,
               'editable': True or False,
               'blank': True or False,
               'validator_list':[...],
               'name':'Field name'}),
             ...]
Decorators: `@model_function`

### getFields(self) | source code
Decorators: `@model_function`

### getListCharts(self) | source code
Decorators: `@model_function`

### getFilters(self) | source code
Return the filters applicable for these entities each filter is Returns: [(filter_name, [(option_name, query_decorator), ...), ... ] Decorators: `@model_function`

### setDefaults(self, entity_instance) | source code
Set the defaults of an object Decorators: `@model_function`

### createNewView(admin, parent=None, oncreate=None, onexpunge=None) | source code
Create a QT widget containing a form to create a new instance of the entity related to this admin class The returned class has an 'entity_created_signal' that will be fired when a a valid new entity was created by the form Decorators: `@gui_function`

### createFormView(admin, title, model, index, parent) | source code
Creates a Qt widget containing a form view, for a specific row of the passed query; uses the Admin class Decorators: `@gui_function`

### createSelectView(admin, query, search_text=None, parent=None) | source code
Returns a QT widget that can be used to select an element from a query, Parameters: `query` - sqlalchemy query object `parent` - the widget that will contain this select view, the returned widget has an entity_selected_signal signal that will be fired when a entity has been selected. Decorators: `@gui_function`

### createTableView(self, query, parent=None) | source code
Returns a QT widget containing a table view, for a certain query, using this Admin class; the table widget contains a model QueryTableModel Parameters: `query` - sqlalchemy query object `parent` - the workspace widget that will contain the table view Decorators: `@gui_function`