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

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

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

revision 1.26 by reinhard, Sat Oct 18 21:20:14 2003 UTC revision 1.27 by reinhard, Sat Oct 18 21:32:32 2003 UTC
# Line 181  class geasInstance: Line 181  class geasInstance:
181    
182      # TODO: from property type: add more tests to see if the new value is valid      # TODO: from property type: add more tests to see if the new value is valid
183    
184      if propertydef.gnue_type == "id" or \      if value == "":
185          value = None
186        elif propertydef.gnue_type == "id" or \
187         propertydef.gnue_type == "string":               propertydef.gnue_type == "string":      
188        # String property (the id is actually a string, too)        # String property (the id is actually a string, too)
189        if value == "":        if type (value) is not types.StringType:
190          value = None          value = str (value)
191        else:        # decode unicode values from utf-8
192          if type (value) is not types.StringType:        value = unicode (value, 'utf-8')
           value = str (value)  
         # decode unicode values from utf-8  
         value = unicode (value, 'utf-8')  
193                        
194      elif propertydef.gnue_type == "number":      elif propertydef.gnue_type == "number":
195        # TODO: check if value is an number        # TODO: check if value is an number
# Line 207  class geasInstance: Line 206  class geasInstance:
206    
207      elif propertydef.gnue_type == "boolean":      elif propertydef.gnue_type == "boolean":
208        # Boolean property        # Boolean property
209        if value == "":        if value in [0, "0", "f", "F", "false", "FALSE", "n", "N", "no", "NO"]:
         value = None  
       elif value in [0, "0", "f", "F", "false", "FALSE", "n", "N", "no", "NO"]:  
210          value = 0          value = 0
211        elif value in [1, "1", "t", "T", "true", "true", "y", "Y", "yes", "YES"]:        elif value in [1, "1", "t", "T", "true", "true", "y", "Y", "yes", "YES"]:
212          value = 1          value = 1

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

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