commit-gnue
[Top][All Lists]
Advanced

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

gnue-forms/src GFConfig.py GFObjects/GFBlock.py


From: Jason Cater
Subject: gnue-forms/src GFConfig.py GFObjects/GFBlock.py
Date: Sun, 31 Aug 2003 00:36:59 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue-forms
Branch:         
Changes by:     Jason Cater <address@hidden>    03/08/31 00:36:59

Modified files:
        src            : GFConfig.py 
        src/GFObjects  : GFBlock.py 

Log message:
        Added AstrickWildcard gnue.conf setting which, if set to true 
(default), then astericks (*) will behave like percents (%) when querying text 
fields (a la Access)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/GFConfig.py.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/GFObjects/GFBlock.py.diff?tr1=1.86&tr2=1.87&r1=text&r2=text

Patches:
Index: gnue-forms/src/GFConfig.py
diff -c gnue-forms/src/GFConfig.py:1.24 gnue-forms/src/GFConfig.py:1.25
*** gnue-forms/src/GFConfig.py:1.24     Wed Jun  4 13:00:16 2003
--- gnue-forms/src/GFConfig.py  Sun Aug 31 00:36:59 2003
***************
*** 395,400 ****
      'Description': 'Fudge factor for altering text size',
      'Typecast'   : GTypecast.number,
      'Default'    : 100.0 },
!   
  
  )
--- 395,406 ----
      'Description': 'Fudge factor for altering text size',
      'Typecast'   : GTypecast.number,
      'Default'    : 100.0 },
! 
!   { 'Name'       : 'AsterickWildcard',
!     'Type'       : 'Setting',
!     'Comment'    : 'Use asterick (*) for wildcards in addition to percent 
(%)',
!     'Description': 'Use asterick (*) for wildcards in addition to percent 
(%)',
!     'Typecast'   : GTypecast.boolean,
!     'Default'    : 1 },
  
  )
Index: gnue-forms/src/GFObjects/GFBlock.py
diff -c gnue-forms/src/GFObjects/GFBlock.py:1.86 
gnue-forms/src/GFObjects/GFBlock.py:1.87
*** gnue-forms/src/GFObjects/GFBlock.py:1.86    Tue Aug 19 22:23:04 2003
--- gnue-forms/src/GFObjects/GFBlock.py Sun Aug 31 00:36:59 2003
***************
*** 51,56 ****
--- 51,57 ----
      GFContainer.__init__(self, parent, 'GFBlock')
  
      self.mode = 'normal'
+     self._convertAstericksToPercent = int(gConfig('AsterickWildcard'))
  
      self._inits = [self.initialize]
  
***************
*** 567,583 ****
      conditionLike = {}
      conditionEq = {}
      # Get all the user-supplied parameters from the entry widgets
!     for entry in block._queryValues.keys():
!         if entry._bound and entry.isQueryable() and 
len(str(block._queryValues[entry])):
            if entry.typecast == 'text':
!             GDebug.printMesg(5,'Adding conditional LIKE (%s like %s)' % 
(entry.field, block._queryValues[entry]))
!             conditionLike[entry.field] = block._queryValues[entry]
            else:
!             GDebug.printMesg(5,'Adding conditional AND (%s=%s)' % 
(entry.field, block._queryValues[entry]))
!             conditionEq[entry.field] = block._queryValues[entry]
  
      if len(conditionLike.keys()) and len(conditionEq.keys()):
!         GDebug.printMesg(5,'Combining like w/and (%s, %s)' % (conditionLike, 
conditionEq))
          conditions = GConditions.combineConditions( \
              GConditions.buildConditionFromDict(conditionLike, 
GConditions.GClike), \
              GConditions.buildConditionFromDict(conditionEq, GConditions.GCeq) 
)
--- 568,590 ----
      conditionLike = {}
      conditionEq = {}
      # Get all the user-supplied parameters from the entry widgets
!     for entry, val in block._queryValues.items():
!         if entry._bound and entry.isQueryable() and len(str(val)):
            if entry.typecast == 'text':
!             if block._convertAstericksToPercent:
!               try:
!                 val = val.replace('*','%')
!               except ValueError:
!                 pass
!               print val
! ##            GDebug.printMesg(5,'Adding conditional LIKE (%s like %s)' % 
(entry.field, val))
!             conditionLike[entry.field] = val
            else:
! ##            GDebug.printMesg(5,'Adding conditional AND (%s=%s)' % 
(entry.field, val))
!             conditionEq[entry.field] = val
  
      if len(conditionLike.keys()) and len(conditionEq.keys()):
! ##        GDebug.printMesg(5,'Combining like w/and (%s, %s)' % 
(conditionLike, conditionEq))
          conditions = GConditions.combineConditions( \
              GConditions.buildConditionFromDict(conditionLike, 
GConditions.GClike), \
              GConditions.buildConditionFromDict(conditionEq, GConditions.GCeq) 
)




reply via email to

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