def serialize_attribute(name,value)
    attr_value = value
    attr_type  = attr_type_for(name) 
    case attr_type
    when :bool
      attr_value = 0
      attr_value = 1 if value
    when :datetime, :datetimecombo
      begin
        attr_value = value.strftime("%Y-%m-%d %H:%M:%S")
      rescue
        attr_value = value
      end
    when :int
      attr_value = value.to_s
    end
    {:name => name, :value => attr_value}
  end
def serialize_attribute(name,value)
    attr_value = value
    attr_type  = attr_type_for(name) 
    case attr_type
    when :bool
      attr_value = 0
      attr_value = 1 if value
    when :datetime, :datetimecombo
      begin
        attr_value = value.strftime("%Y-%m-%d %H:%M:%S")
      rescue
        attr_value = value
      end
    when :int
      attr_value = value.to_s
    end
    {:name => name, :value => attr_value}
  end
Un-typecasts the attribute - false becomes "0", 5234 becomes "5234", etc.