[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7569 - trunk/gnue-common/src/datasources/drivers/Base
From: |
reinhard |
Subject: |
[gnue] r7569 - trunk/gnue-common/src/datasources/drivers/Base |
Date: |
Wed, 1 Jun 2005 17:14:36 -0500 (CDT) |
Author: reinhard
Date: 2005-06-01 17:14:35 -0500 (Wed, 01 Jun 2005)
New Revision: 7569
Modified:
trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
Log:
Some minor code cleanup, some comments and docstrings.
Modified: trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2005-06-01
21:42:47 UTC (rev 7568)
+++ trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2005-06-01
22:14:35 UTC (rev 7569)
@@ -21,20 +21,27 @@
#
# $Id$
-__all__ = ['ResultSet']
+"""
+Generic ResultSet class extended by all database driver plugins.
+"""
-import string
-
from gnue.common.datasources import Exceptions
from RecordSet import RecordSet
+
# =============================================================================
# Basic ResultSet class
# =============================================================================
class ResultSet:
+ """
+ Representation of a database resultset (a set of records usually representing
+ the result of a database query).
+ A ResultSet instance encapsulated an ordered set of database records.
+ """
+
# ---------------------------------------------------------------------------
# Constructor
# ---------------------------------------------------------------------------
@@ -120,6 +127,21 @@
# ---------------------------------------------------------------------------
+ # String representation
+ # ---------------------------------------------------------------------------
+
+ def __repr__ (self):
+ """
+ Shows a string representation of the RecordSet.
+ """
+
+ if self.__tablename:
+ return "<ResultSet for %s at %d>" % (self.__tablename, id (self))
+ else:
+ return "<Unbound/Static ResultSet at %d>" % id (self)
+
+
+ # ---------------------------------------------------------------------------
# Execute a query
# ---------------------------------------------------------------------------
@@ -177,17 +199,12 @@
# Returns True if the resultset or a detail resultset has uncommitted changes
def isPending (self):
- for rec in (self.__cachedRecords):
+ for rec in self.__cachedRecords:
if rec.isPending ():
return True
return False
- # ---------------------------------------------------------------------------
- # Returns True if the current record has uncommitted changes
- def isRecordPending (self):
- return self.current.isPending ()
-
# ---------------------------------------------------------------------------
# Create a new RecordSet instance
# ---------------------------------------------------------------------------
@@ -754,16 +771,5 @@
return record
- # ---------------------------------------------------------------------------
- # Nice string representation
- # ---------------------------------------------------------------------------
-
- def __repr__ (self):
- if self.__tablename:
- return "<ResultSet for %s>" % self.__tablename
- else:
- return "<Unbound/Static ResultSet>"
-
-
# TODO: wtf?
postingRecordset = None
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7569 - trunk/gnue-common/src/datasources/drivers/Base,
reinhard <=