79 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
80 |
|
|
81 |
def populate (self): |
def populate (self): |
82 |
self._datasource = GDataSource.GDataSource () |
attributes = {} |
83 |
self._datasource.buildObject (name = "", |
attributes ["name"] = "" |
84 |
database = self._session._database, |
attributes ["database"] = self._session._database |
85 |
table = self._classdef.table) |
attributes ["table"] = self._classdef.table |
|
self._datasource.setConnectionManager (self._session._connections) |
|
|
|
|
|
# bug fix should be moved into common after the freeze |
|
|
self._datasource._datasourceDictionary={} |
|
|
|
|
|
# set the property to sort (has to be called before phase init) |
|
86 |
if self._sortColumns != []: |
if self._sortColumns != []: |
87 |
self._datasource.order_by = string.joinfields(self._sortColumns, ",") |
attributes ["order_by"] = string.joinfields (self._sortColumns, ",") |
|
|
|
|
self._datasource.phaseInit () |
|
88 |
|
|
89 |
for column in self._prefColumns: |
self._datasource = GDataSource.DataSourceWrapper ( |
90 |
self._datasource.referenceField (column) |
connections = self._session._connections, |
91 |
|
attributes = attributes, |
92 |
|
fields = self._prefColumns) |
93 |
|
|
94 |
if hasattr(self,"_conditionTree"): |
self._resultset = self._datasource.createResultSet (self._conditionTree) |
|
self._resultset = self._datasource.createResultSet (self._conditionTree) |
|
|
else: |
|
|
self._resultset = self._datasource.createResultSet () |
|
95 |
|
|
96 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
97 |
# Get the first instance in the list |
# Get the first instance in the list |