28 |
# |
# |
29 |
|
|
30 |
from gnue.common.events.EventAware import EventAware |
from gnue.common.events.EventAware import EventAware |
31 |
|
from gnue.common.datasources import GConditions |
32 |
|
from gnue.common.datasources.GDataSource import DataSourceWrapper |
33 |
|
|
34 |
|
CONN = gConfig('BackendConnection') |
35 |
|
|
36 |
class Driver(EventAware): |
class Driver(EventAware): |
37 |
|
|
57 |
self.init() |
self.init() |
58 |
|
|
59 |
|
|
60 |
|
def _getResultSet(self, table, fields, conditions={}): |
61 |
|
datasource = DataSourceWrapper(self.instance.connections, |
62 |
|
fields=fields, |
63 |
|
attributes={'connection': CONN, |
64 |
|
'name': 'dts%s' % table, |
65 |
|
'table': table } ) |
66 |
|
resultset = datasource.createResultSet( |
67 |
|
conditions=conditions, |
68 |
|
readOnly=1) |
69 |
|
return resultset |
70 |
|
|
71 |
|
def _createResultSet(self, table, fields): |
72 |
|
datasource = DataSourceWrapper(self.instance.connections, |
73 |
|
fields=fields, |
74 |
|
attributes={'connection': CONN, |
75 |
|
'name': 'dts%s' % table, |
76 |
|
'table': table } ) |
77 |
|
resultset = datasource.createEmptyResultSet() |
78 |
|
return resultset |
79 |
|
|