[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/appserver/src frontend.py geasList.py geas...
From: |
Reinhard Mueller |
Subject: |
gnue/appserver/src frontend.py geasList.py geas... |
Date: |
Sat, 28 Dec 2002 08:31:29 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Reinhard Mueller <address@hidden> 02/12/28 08:31:29
Modified files:
appserver/src : frontend.py geasList.py geasSession.py
Log message:
Implemented "count" function of the new API
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/frontend.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasList.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasSession.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
Patches:
Index: gnue/appserver/src/frontend.py
diff -c gnue/appserver/src/frontend.py:1.1 gnue/appserver/src/frontend.py:1.2
*** gnue/appserver/src/frontend.py:1.1 Fri Dec 27 18:04:23 2002
--- gnue/appserver/src/frontend.py Sat Dec 28 08:31:29 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: frontend.py,v 1.1 2002/12/27 23:04:23 reinhard Exp $
import os, getpass
from gnue.common import GClientApp
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: frontend.py,v 1.2 2002/12/28 13:31:29 reinhard Exp $
import os, getpass
from gnue.common import GClientApp
***************
*** 62,68 ****
def display (self, server, session, list, propertylist):
start = askint ("Start with object number", "0")
! count = askint ("Number of objects to display", "1")
rset = server.fetch (session, list, start, count)
for index in range (0, count):
--- 62,75 ----
def display (self, server, session, list, propertylist):
start = askint ("Start with object number", "0")
!
! # get maximum possible object count from given start position
! if start < 0: # from end of list
! maxcount = -start
! else:
! maxcount = server.count (session, list) - start
!
! count = askint ("Number of objects to display", "%d" % maxcount)
rset = server.fetch (session, list, start, count)
for index in range (0, count):
***************
*** 71,77 ****
for property in propertylist:
print "* " + property + ":", object [property]
-
#
---------------------------------------------------------------------------
# Main loop
#
---------------------------------------------------------------------------
--- 78,83 ----
***************
*** 117,122 ****
--- 123,131 ----
# request the list
list = server.requestList (session, classname, [], sortlist,
propertylist)
+
+ count = server.count (session, list)
+ print "* The requested list contains %d entries" % count
self.display (server, session, list, propertylist)
Index: gnue/appserver/src/geasList.py
diff -c gnue/appserver/src/geasList.py:1.12 gnue/appserver/src/geasList.py:1.13
*** gnue/appserver/src/geasList.py:1.12 Fri Nov 29 09:16:20 2002
--- gnue/appserver/src/geasList.py Sat Dec 28 08:31:29 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasList.py,v 1.12 2002/11/29 14:16:20 siesel 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.13 2002/12/28 13:31:29 reinhard Exp $
from gnue.common import GDataSource,GConditions
import geasInstance
***************
*** 134,141 ****
self._resultset.insertRecord ()
return geasInstance.geasInstance (self, self._resultset.current)
! def getLength(self):
! pass
def isEmpty(self):
pass
--- 134,145 ----
self._resultset.insertRecord ()
return geasInstance.geasInstance (self, self._resultset.current)
! #
---------------------------------------------------------------------------
! # get the length of the list (the number of entries)
! #
---------------------------------------------------------------------------
!
! def getLength (self):
! return self._resultset.getRecordCount ()
def isEmpty(self):
pass
Index: gnue/appserver/src/geasSession.py
diff -c gnue/appserver/src/geasSession.py:1.12
gnue/appserver/src/geasSession.py:1.13
*** gnue/appserver/src/geasSession.py:1.12 Fri Dec 27 17:56:47 2002
--- gnue/appserver/src/geasSession.py Sat Dec 28 08:31:29 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasSession.py,v 1.12 2002/12/27 22:56:47 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.13 2002/12/28 13:31:29 reinhard Exp $
import geasList
import geasTrigger
***************
*** 116,122 ****
# ---------------------------------------
#
---------------------------------------------------------------------------
! # Create a new list of business objects of a given class
#
---------------------------------------------------------------------------
def _getClass(self, classname):
--- 116,122 ----
# ---------------------------------------
#
---------------------------------------------------------------------------
! # Get the BClass object for the given classname
#
---------------------------------------------------------------------------
def _getClass(self, classname):
***************
*** 143,151 ****
return newbclass;
! def requestList(self,classname,conditions,
! sortorder,propertylist):
# TODO move the whole function into the session obj
a_list=self.createList(classname)
list_id=self._listcount
--- 143,154 ----
return newbclass;
+ #
---------------------------------------------------------------------------
+ # Create a new list of business objects of a given class
+ #
---------------------------------------------------------------------------
! def requestList (self, classname, conditions,
! sortorder, propertylist):
# TODO move the whole function into the session obj
a_list=self.createList(classname)
list_id=self._listcount
***************
*** 158,165 ****
return list_id;
! def count(self,list_id):
! return self._lists[list_id].count();
def fetch(self,list_id,start,count):
rset=[]
--- 161,177 ----
return list_id;
! #
---------------------------------------------------------------------------
! # Count the number of objects in the list
! #
---------------------------------------------------------------------------
!
! def count (self, list_id):
! list = self._lists [list_id]
! return list.getLength ();
!
! #
---------------------------------------------------------------------------
! # Fetch data from the database backend
! #
---------------------------------------------------------------------------
def fetch(self,list_id,start,count):
rset=[]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/appserver/src frontend.py geasList.py geas...,
Reinhard Mueller <=