commit-gnue
[Top][All Lists]
Advanced

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

gnue common/src/GDataSource.py forms/src/GFForm...


From: Jason Cater
Subject: gnue common/src/GDataSource.py forms/src/GFForm...
Date: Wed, 15 May 2002 21:14:45 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/05/15 21:14:44

Modified files:
        common/src     : GDataSource.py 
        forms/src      : GFForm.py 
        reports/src    : GRSources.py 

Log message:
        moved more master/detail datasource logic out of tools and into common

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/GDataSource.py.diff?cvsroot=OldCVS&tr1=1.32&tr2=1.33&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/GFForm.py.diff?cvsroot=OldCVS&tr1=1.167&tr2=1.168&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRSources.py.diff?cvsroot=OldCVS&tr1=1.10&tr2=1.11&r1=text&r2=text

Patches:
Index: gnue/common/src/GDataSource.py
diff -c gnue/common/src/GDataSource.py:1.32 gnue/common/src/GDataSource.py:1.33
*** gnue/common/src/GDataSource.py:1.32 Wed May  8 23:03:44 2002
--- gnue/common/src/GDataSource.py      Wed May 15 21:14:43 2002
***************
*** 130,135 ****
--- 130,138 ----
           self._connections.getDataObject(self.database, self.type)
        GDebug.printMesg (7, "GDataSource.py bound to %s " % self._dataObject)
  
+     self.name = string.lower(self.name)
+     self._topObject._datasourceDictionary[self.name]=self
+ 
      dataObject._fieldReferences = self._fieldReferences
      dataObject._unboundFieldReferences = self._unboundFieldReferences
      dataObject._defaultValues = self._defaultValues
***************
*** 231,236 ****
--- 234,244 ----
    def secondaryInit(self):
  
      if hasattr(self, 'master') and self.master:
+ 
+       print self._toplevelParent
+       print self._topObject
+       print self._topObject._datasourceDictionary
+ 
        self.master = string.lower(self.master)
        GDebug.printMesg(3,"Linking detail '%s' to master '%s'" \
                           % (self.name, self.master) )
Index: gnue/forms/src/GFForm.py
diff -c gnue/forms/src/GFForm.py:1.167 gnue/forms/src/GFForm.py:1.168
*** gnue/forms/src/GFForm.py:1.167      Tue May  7 12:53:29 2002
--- gnue/forms/src/GFForm.py    Wed May 15 21:14:44 2002
***************
*** 1,6 ****
  #
- # Copyright 2000-2002 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2000-2002 Free Software Foundation
+ #
  # FILE:
  # GFForm.py
  #
***************
*** 175,184 ****
      elif object._type in TabStops and self._currentEntry == None and \
           not object.hidden and not object.readonly:
        self._currentEntry = object
- 
-     elif object._type =='GFDataSource':
-       object.name = string.lower(object.name)
-       self._datasourceDictionary[object.name]=object
  
  
    #
--- 175,180 ----
Index: gnue/reports/src/GRSources.py
diff -c gnue/reports/src/GRSources.py:1.10 gnue/reports/src/GRSources.py:1.11
*** gnue/reports/src/GRSources.py:1.10  Wed Apr 17 15:09:19 2002
--- gnue/reports/src/GRSources.py       Wed May 15 21:14:44 2002
***************
*** 50,91 ****
      # Connect to databases
      self._datasourceDictionary = {}
      self.walk(self.__initConnections)
!     self.walk(self.__connectMasterDetail)
!     self.walk(self.__setUserOptions)
  
  
    # Used internally by self.prepare()
    # Connects to databases
    def __initConnections(self, object):
      if object._type == "GRDataSource":
!       GDebug.printMesg(3,"Connecting DataSource '%s' to connection '%s'" \
!                          % (object.name, object.database) )
        object.connect()
!       self._datasourceDictionary[object.name] = object
  
!   def __connectMasterDetail(self, object):
!     if object._type == "GRDataSource" and object.master != None:
!       GDebug.printMesg(3,"Linking detail '%s' to master '%s'" \
!                          % (object.name, object.master) )
!       if self._datasourceDictionary.has_key(object.master):
!         self._datasourceDictionary[object.master] \
!             .getDataObject().addDetailDataObject(object.getDataObject(),
!                                                  object)
!       else:
!         raise GRExceptions.MasterSourceNotFound, \
!            "Detail source '%s' references non-existant master '%s'" \
!                          % (object.name, object.master)
! 
!   def __setUserOptions(self, object):
!     if object._type == 'GRParam':
!       object._value = self._parameters.getParameter(object.name)
  
  #    if object._type == 'GRSortOption':
  #      pass
  
  
    def getDataSource(self, source):
!     return self._datasourceDictionary[source]
  
  
  class GRDataSource (GDataSource.GDataSource):
--- 50,91 ----
      # Connect to databases
      self._datasourceDictionary = {}
      self.walk(self.__initConnections)
! ##    self.walk(self.__connectMasterDetail)
! ##    self.walk(self.__setUserOptions)
  
  
    # Used internally by self.prepare()
    # Connects to databases
    def __initConnections(self, object):
      if object._type == "GRDataSource":
! ##      GDebug.printMesg(3,"Connecting DataSource '%s' to connection '%s'" \
! ##                         % (object.name, object.database) )
        object.connect()
! ##      self._datasourceDictionary[object.name] = object
  
! ##  def __connectMasterDetail(self, object):
! ##    if object._type == "GRDataSource" and object.master != None:
! ##      GDebug.printMesg(3,"Linking detail '%s' to master '%s'" \
! ##                         % (object.name, object.master) )
! ##      if self._datasourceDictionary.has_key(object.master):
! ##        self._datasourceDictionary[object.master] \
! ##            .getDataObject().addDetailDataObject(object.getDataObject(),
! ##                                                 object)
! ##      else:
! ##        raise GRExceptions.MasterSourceNotFound, \
! ##           "Detail source '%s' references non-existant master '%s'" \
! ##                         % (object.name, object.master)
! 
! ##  def __setUserOptions(self, object):
! ##    if object._type == 'GRParam':
! ##      object._value = self._parameters.getParameter(object.name)
  
  #    if object._type == 'GRSortOption':
  #      pass
  
  
    def getDataSource(self, source):
!     return self._parent._datasourceDictionary[source]
  
  
  class GRDataSource (GDataSource.GDataSource):



reply via email to

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