Package gnue :: Package appserver :: Module geasSession :: Class geasSession
[show private | hide private]

Class geasSession


Method Summary
  __init__(self, connections, authAdapter, sm, params)
  call(self, classname, obj_id_list, procedurename, parameters)
Call a procedure of a given class on a sequence of gnue_id's.
  commit(self)
This function commit the currently running transaction.
  delete(self, classname, obj_id_list)
Delete objects of a given class.
  load(self, classname, obj_id_list, propertylist)
Load data or datatypes of a given class from the database backend.
  request(self, classname, conditions, sortorder, propertylist)
Create a new list instance containing all items of a given class matching the requested conditions.
  rollback(self)
Rollback the active transaction.
  store(self, classname, obj_id_list, propertylist, data)
Store data for a given class in the backend database.

Method Details

__init__(self, connections, authAdapter, sm, params)
(Constructor)

call(self, classname, obj_id_list, procedurename, parameters)

Call a procedure of a given class on a sequence of gnue_id's.
Parameters:
classname - name of the class
obj_id_list - sequence of gnue_id's representing the objects to call the procedure for
procedurename - name of the procedure to call
parameters - dictionary of parameters to pass to each call
Returns:
sequence of sequences with the procedure-results one per gnue_id

commit(self)

This function commit the currently running transaction. But before the backend will be requested to do so, all dirty instances are validated.

delete(self, classname, obj_id_list)

Delete objects of a given class. A single call of this function is treated as an atomic operation. If on delete fails, all previous deletes will be revoked.
Parameters:
classname - name of the class to delete objects from
obj_id_list - sequence of gnue_id's representing the objects to delete

load(self, classname, obj_id_list, propertylist)

Load data or datatypes of a given class from the database backend.
Parameters:
classname - name of the class to retrieve data for
obj_id_list - sequence of gnue_id's to fetch data for. If such a gnue_id is None the datatypes of the properties will be fetched instead of the data values.
propertylist - sequence of propertynames to fetch data or datatypes for.
Returns:
sequence of sequences holding the result-values (one per gnue_id)

request(self, classname, conditions, sortorder, propertylist)

Create a new list instance containing all items of a given class matching the requested conditions. The elements are sorted according to the given sortorder and preloaded with the given properties.
Parameters:
classname - name of the class to fetch items from
conditions - a condition (list, dictionary, GConditionTree, ...) acceptable to GCondition.buildCondition to filter items
sortorder -

list of sort-instructions to build the resulting list. Such a sort-instruction could be a string, a tuple, a list or a dictionary. A sort item consists of three parts: propertyname, sort-direction and case-sensitiveness.

string : propertyname tuple, list: (propertyname, descending, ignorecase) dictionary : {'name': ..., 'descending': ..., 'ignorecase': ...}

A sort item must not be completeley defined. If an element is omitted, the following defaults apply: descending = False, ignorecase = False
propertylist - sequence of properties to fetch for each item in the resulting list. Such propertynames could also be reference properties like 'x_foo.y_bar'. In this case the needed join would be added automatically.
Returns:
geasList.geasList instance

rollback(self)

Rollback the active transaction.

store(self, classname, obj_id_list, propertylist, data)

Store data for a given class in the backend database. All changes within a single call of this function are treated as an atomic operation. The update stamps (gnue_create*, gnue_modify*) will be updated automatically if needed.
Parameters:
classname - name of the class to store data for
obj_id_list - sequence of gnue_id's representing the objects to store data for. A gnue_id of None represents a new object. In this case a new gnue_id will be generated.
propertylist - sequence of the properties to store data for
data - sequence of sequences with the actual data values, one sequence per object-id. Order of propertylist and data-sequence must match.


GNUe Home

Public API

Developer's Corner