/[gnue]/gnue-appserver/src/geasSession.py
ViewVC logotype

Diff of /gnue-appserver/src/geasSession.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29 by reinhard, Mon Aug 11 15:26:54 2003 UTC revision 1.30 by reinhard, Tue Aug 12 17:04:52 2003 UTC
# Line 69  class geasSession: Line 69  class geasSession:
69    # Get class definition from class name    # Get class definition from class name
70    # ---------------------------------------------------------------------------    # ---------------------------------------------------------------------------
71    
72    def getClassdef (self, classname):    def _getClassdef (self, classname):
73      return classrep.classes [classname]      return classrep.classes [classname]
74    
75    # ---------------------------------------------------------------------------    # ---------------------------------------------------------------------------
# Line 98  class geasSession: Line 98  class geasSession:
98    
99    def createList (self, classname):    def createList (self, classname):
100            
101      classdef = self.getClassdef (classname)      classdef = self._getClassdef (classname)
102    
103      # check if user has access rights for this list      # check if user has access rights for this list
104      if not self._authAdapter.hasAccess (self, self._user, classname):      if not self._authAdapter.hasAccess (self, self._user, classname):
# Line 112  class geasSession: Line 112  class geasSession:
112  #       tr()  #       tr()
113                
114      # create new List      # create new List
115      newlist=geasList.geasList (self, classname)      newlist = geasList.geasList (self, classdef)
116      # every new list will be added to the _lists list      # every new list will be added to the _lists list
117      # which will be parsed for commit and rollback actions      # which will be parsed for commit and rollback actions
118      self._listcount+=1      self._listcount += 1
119      self._lists[self._listcount]=newlist      self._lists [self._listcount] = newlist
120      return newlist;      return newlist;
121        
122    # ---------------------------------------------------------------------------    # ---------------------------------------------------------------------------
# Line 181  class geasSession: Line 181  class geasSession:
181    
182    def load (self, classname, obj_id_list, propertylist):    def load (self, classname, obj_id_list, propertylist):
183      # create a temporary geasList      # create a temporary geasList
184      list = geasList.geasList (self, classname)      classdef = self._getClassdef (classname)
185        list = geasList.geasList (self, classdef)
186      list.setPrefetch (["gnue_id"] + propertylist)      list.setPrefetch (["gnue_id"] + propertylist)
187      list.setSort (["gnue_id"])      list.setSort (["gnue_id"])
188      # Accessing the database for every single object_id is not very elegant,      # Accessing the database for every single object_id is not very elegant,
# Line 192  class geasSession: Line 193  class geasSession:
193                             ['const', object_id]])                             ['const', object_id]])
194        list.populate ()        list.populate ()
195        object = list.firstInstance ()        object = list.firstInstance ()
196        row = {}        row = []
197        for property in propertylist:        for property in propertylist:
198          row [property] = object.get (property)          value = object.get (property)
199            ## TRANSFER None as ""
200            if value == None:
201              value = ""
202            row.append (value)
203        result.append (row)        result.append (row)
204      return result      return result
205    
# Line 264  class geasSession: Line 269  class geasSession:
269    
270    def call(self,classname,obj_id_list,methodname,parameters):        def call(self,classname,obj_id_list,methodname,parameters):    
271      # create a temporary geasList      # create a temporary geasList
272      list = geasList.geasList (self, classname)      classdef = self._getClassdef (classname)
273        list = geasList.geasList (self, classdef)
274      list.setPrefetch (["gnue_id"]) # + propertylist) TODO: fetch propertylist      list.setPrefetch (["gnue_id"]) # + propertylist) TODO: fetch propertylist
275      list.setSort (["gnue_id"])      list.setSort (["gnue_id"])
276      # Accessing the database for every single object_id is not very elegant,      # Accessing the database for every single object_id is not very elegant,

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26