33 |
|
|
34 |
__all__ = ['ResultSet'] |
__all__ = ['ResultSet'] |
35 |
|
|
36 |
from gnue.common.datasources import GDataObjects, GConditions |
from gnue.common.datasources import GConditions, Exceptions |
37 |
|
from gnue.common.datasources.drivers.Base import ResultSet as BaseResultSet |
38 |
from gnue.common.apps import GDebug |
from gnue.common.apps import GDebug |
39 |
import string |
import string |
40 |
import types |
import types |
41 |
|
|
42 |
from RecordSet import RecordSet |
from RecordSet import RecordSet |
43 |
|
|
44 |
class ResultSet(GDataObjects.ResultSet): |
class ResultSet(BaseResultSet): |
45 |
def __init__(self, dataObject, cursor=None, \ |
_recordSetClass = RecordSet |
46 |
defaultValues={}, masterRecordSet=None): |
def __init__(self, *args, **parms): |
47 |
GDataObjects.ResultSet.__init__( |
BaseResultSet.__init__(self, *args, **parms) |
|
self,dataObject,cursor,defaultValues,masterRecordSet) |
|
|
self._recordSetClass = RecordSet |
|
48 |
self._fieldNames = [] |
self._fieldNames = [] |
49 |
|
|
50 |
if self._cursor: |
if self._cursor: |
52 |
self._fieldNames.append(t[0]) |
self._fieldNames.append(t[0]) |
53 |
GDebug.printMesg(5, "Field names set to %s" % self._fieldNames) |
GDebug.printMesg(5, "Field names set to %s" % self._fieldNames) |
54 |
|
|
55 |
self._recordCount = cursor.rowcount or 0 |
self._recordCount = self._cursor.rowcount or 0 |
56 |
|
|
57 |
GDebug.printMesg(5, 'ResultSet created') |
GDebug.printMesg(5, 'ResultSet created') |
58 |
|
|
63 |
try: |
try: |
64 |
rsets = self._cursor.fetchmany() |
rsets = self._cursor.fetchmany() |
65 |
except self._dataObject._DatabaseError, err: |
except self._dataObject._DatabaseError, err: |
66 |
raise GDataObjects.ConnectionError, err |
raise Exceptions.ConnectionError, err |
67 |
if rsets and len(rsets): |
if rsets and len(rsets): |
68 |
for rs in(rsets): |
for rs in(rsets): |
69 |
if rs: |
if rs: |