Proxy representing a collection of entities that live in the model thread.
The proxy represents them in the gui thread and provides access to the data with zero delay. If the data is not yet present in the proxy, dummy data is returned and an update signal is emitted when the correct data is available.
The CollectionProxy contains a limited copy of the data in the actual collection, usable for fast visualisation in a QTableView
the CollectionProxy has some class attributes that can be overwritten when subclassing it :
Append an object to this collection, set the possible defaults and flush the object if possible/needed
Parameters: |
|
---|---|
Returns: | the new number of rows in the collection |
Returns: | the data at index for the specified role |
---|
This function will return ValueLoading when the data has not yet been fetched from the underlying model. It will then send a request to the model thread to fetch this data. Once the data is readily available, the dataChanged signal will be emitted
Using Qt.UserRole as a role will return all the field attributes of the index.
Using Qt.UserRole+1 will return the object of which an attribute is displayed in that specific cell
Returns: | a DelegateManager for this model, or None if no DelegateManager yet available |
---|
a DelegateManager will be available once the item_delegate_changed signal has been emitted
Handles the entity signal, indicating that the model is out of date
Handles the entity signal, indicating that the model is out of date
Handles the entity signal, indicating that the model is out of date
The model has rows that have not been flushed to the database yet, because the row is invalid
In case the columns have not been set yet, don’t even try to get information out of them
Converts a sorted row number to a row number of the source collection
Callback method to set the columns
Parameters: | columns – a list with fields to be displayed of the form [(‘field_name’, field_attributes), ...] as |
---|
returned by the getColumns method of the ElixirAdmin class
Value should be a function taking no arguments that returns the data to be set
This function will then be called in the model_thread
A proxy object needs to be constructed within the GUI thread. Construct a delayed proxy when the construction of a proxy is needed within the Model thread. On first occasion the delayed proxy will be converted to a real proxy within the GUI thread
Subclass of dictionary to fool the QVariant object and prevent it from converting dictionary keys to whatever Qt object, but keep everything python
Class mapping rows of a collection 1:1 without sorting and filtering, unless a mapping has been defined explicitly
For every column in columns, get the corresponding value from the object. Getting a value from an object is time consuming, so using this function should be minimized. :param obj: the object of which to get data :param columns: a list of columns for which to get data