commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/appserver/src geasList.py geasSession.py


From: Reinhard Mueller
Subject: gnue/appserver/src geasList.py geasSession.py
Date: Sat, 04 Jan 2003 11:53:50 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Reinhard Mueller <address@hidden>       03/01/04 11:53:50

Modified files:
        appserver/src  : geasList.py geasSession.py 

Log message:
        Moved actual implementation of "fetch" from geasSession.py to 
geasList.py

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasList.py.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasSession.py.diff?tr1=1.17&tr2=1.18&r1=text&r2=text

Patches:
Index: gnue/appserver/src/geasList.py
diff -c gnue/appserver/src/geasList.py:1.14 gnue/appserver/src/geasList.py:1.15
*** gnue/appserver/src/geasList.py:1.14 Wed Jan  1 19:45:40 2003
--- gnue/appserver/src/geasList.py      Sat Jan  4 11:53:50 2003
***************
*** 19,25 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasList.py,v 1.14 2003/01/02 00:45:40 jcater Exp $
  
  from gnue.common import GDataSource,GConditions
  import geasInstance
--- 19,25 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasList.py,v 1.15 2003/01/04 16:53:50 reinhard Exp $
  
  from gnue.common import GDataSource,GConditions
  import geasInstance
***************
*** 127,132 ****
--- 127,150 ----
        return None
  
    # 
---------------------------------------------------------------------------
+   # Fetch data from the database backend
+   # 
---------------------------------------------------------------------------
+ 
+   def fetch (self, start, count):
+     result = []
+     c = 0
+     object = self.firstInstance ()
+     while (object != None) and (c < start + count):
+       if c >= start:
+         row = {}
+         for property in self._prefetch:
+           row [property] = object.get (property)
+         result.append (row)
+       c += 1
+       object = self.nextInstance ()
+     return result
+ 
+   # 
---------------------------------------------------------------------------
    # insert a new empty instance in the list and return it 
    # 
---------------------------------------------------------------------------
  
***************
*** 138,154 ****
    # get the length of the list (the number of entries)
    # 
---------------------------------------------------------------------------
  
!   def getLength (self):
      return self._resultset.getRecordCount ()
- 
-   def isEmpty(self):
-     pass
- 
-   def isFirst(self):
-     pass
- 
-   def isLast(self):
-     pass
- 
-   def previousItem(self):
-     pass
--- 156,160 ----
    # get the length of the list (the number of entries)
    # 
---------------------------------------------------------------------------
  
!   def count (self):
      return self._resultset.getRecordCount ()
Index: gnue/appserver/src/geasSession.py
diff -c gnue/appserver/src/geasSession.py:1.17 
gnue/appserver/src/geasSession.py:1.18
*** gnue/appserver/src/geasSession.py:1.17      Sat Jan  4 11:30:38 2003
--- gnue/appserver/src/geasSession.py   Sat Jan  4 11:53:50 2003
***************
*** 19,25 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasSession.py,v 1.17 2003/01/04 16:30:38 reinhard Exp $
  
  import geasList
  import geasTrigger 
--- 19,25 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasSession.py,v 1.18 2003/01/04 16:53:50 reinhard Exp $
  
  import geasList
  import geasTrigger 
***************
*** 165,171 ****
  
    def count (self, list_id):
      list = self._lists [list_id]
!     return list.getLength ();
  
    # 
---------------------------------------------------------------------------
    # Fetch data from the database backend
--- 165,171 ----
  
    def count (self, list_id):
      list = self._lists [list_id]
!     return list.count ();
  
    # 
---------------------------------------------------------------------------
    # Fetch data from the database backend
***************
*** 173,190 ****
  
    def fetch (self, list_id, start, count):
      list = self._lists [list_id]
!     result = []
!     c = 0
!     object = list.firstInstance ()
!     while (object != None) and (c < start + count):
!       if c >= start:
!         row = {}
!         for property in list._prefetch:
!           row [property] = object.get (property)
!         result.append (row)
!       c += 1
!       object = list.nextInstance ()
!     return result
  
    # 
---------------------------------------------------------------------------
    # Load data from the database backend
--- 173,179 ----
  
    def fetch (self, list_id, start, count):
      list = self._lists [list_id]
!     return list.fetch (start, count)
  
    # 
---------------------------------------------------------------------------
    # Load data from the database backend




reply via email to

[Prev in Thread] Current Thread [Next in Thread]