Attachment 'Form.py.MySQL.patch'

Download

   1 --- Form-0.8alpha.py	2008-02-03 23:06:07.000000000 -0800
   2 +++ Form.py	2008-02-29 10:15:20.000000000 -0800
   3 @@ -130,7 +130,7 @@
   4                  field_type = field_data[1]
   5                  if record:
   6                      value = record[field_data[0]]
   7 -                    if field_type not in self.datetime_types and field_type:
   8 +                    if field_type not in self.datetime_types and field_type and callable(field_type):
   9                          value = field_type(value)
  10                  self.variables['%s.%s' % (form_key, field)] = value
  11             
  12 @@ -238,7 +238,7 @@
  13              value = self.post_args.get(field_key, [u''])[index]
  14              form = self.forms[form_key]
  15              field_type = form['fields'][field_name][1]
  16 -            if field_type:
  17 +            if field_type and callable(field_type):
  18                  value = field_type(value)
  19          if value == '':
  20              value = None
  21 @@ -406,6 +406,7 @@
  22          elif connection_type == 'mysql':
  23              import MySQLdb
  24              port = connection_dict.get('port', '3306').strip('`')
  25 +            port = int(port)
  26              self.connection = MySQLdb.connect(host = self.get_stripped_from_connection_dict('server'), port = port, user = self.get_stripped_from_connection_dict('uid'), passwd = self.get_stripped_from_connection_dict('pwd'),db = self.get_stripped_from_connection_dict('database'))
  27  
  28          elif connection_type == 'oracle':

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2008-02-29 18:23:58, 1.4 KB) [[attachment:Form.py.MySQL.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.