<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>web2py.gluon.contrib.pymysql.converters</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="web2py.gluon-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.web2py.com">web2py Web Framework</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
Package web2py ::
<a href="web2py.gluon-module.html">Package gluon</a> ::
Package contrib ::
<a href="web2py.gluon.contrib.pymysql-module.html">Package pymysql</a> ::
Module converters
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>] | <a href="web2py.gluon.contrib.pymysql.converters-module.html"
target="_top">no frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module converters</h1><span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html">source code</a></span><br /><br />
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Functions</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Functions"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="convert_bit"></a><span class="summary-sig-name">convert_bit</span>(<span class="summary-sig-arg">connection</span>,
<span class="summary-sig-arg">field</span>,
<span class="summary-sig-arg">b</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_bit">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="convert_characters"></a><span class="summary-sig-name">convert_characters</span>(<span class="summary-sig-arg">connection</span>,
<span class="summary-sig-arg">field</span>,
<span class="summary-sig-arg">data</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_characters">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="web2py.gluon.contrib.pymysql.converters-module.html#convert_date" class="summary-sig-name">convert_date</a>(<span class="summary-sig-arg">connection</span>,
<span class="summary-sig-arg">field</span>,
<span class="summary-sig-arg">obj</span>)</span><br />
Returns a DATE column as a date object:</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_date">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="web2py.gluon.contrib.pymysql.converters-module.html#convert_datetime" class="summary-sig-name">convert_datetime</a>(<span class="summary-sig-arg">connection</span>,
<span class="summary-sig-arg">field</span>,
<span class="summary-sig-arg">obj</span>)</span><br />
Returns a DATETIME or TIMESTAMP column value as a datetime
object:</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_datetime">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="convert_decimal"></a><span class="summary-sig-name">convert_decimal</span>(<span class="summary-sig-arg">connection</span>,
<span class="summary-sig-arg">field</span>,
<span class="summary-sig-arg">data</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_decimal">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="convert_float"></a><span class="summary-sig-name">convert_float</span>(<span class="summary-sig-arg">connection</span>,
<span class="summary-sig-arg">field</span>,
<span class="summary-sig-arg">data</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_float">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="convert_int"></a><span class="summary-sig-name">convert_int</span>(<span class="summary-sig-arg">connection</span>,
<span class="summary-sig-arg">field</span>,
<span class="summary-sig-arg">data</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_int">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="convert_long"></a><span class="summary-sig-name">convert_long</span>(<span class="summary-sig-arg">connection</span>,
<span class="summary-sig-arg">field</span>,
<span class="summary-sig-arg">data</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_long">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="web2py.gluon.contrib.pymysql.converters-module.html#convert_mysql_timestamp" class="summary-sig-name">convert_mysql_timestamp</a>(<span class="summary-sig-arg">connection</span>,
<span class="summary-sig-arg">field</span>,
<span class="summary-sig-arg">timestamp</span>)</span><br />
Convert a MySQL TIMESTAMP to a Timestamp object.</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_mysql_timestamp">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="convert_set"></a><span class="summary-sig-name">convert_set</span>(<span class="summary-sig-arg">s</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_set">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="web2py.gluon.contrib.pymysql.converters-module.html#convert_time" class="summary-sig-name">convert_time</a>(<span class="summary-sig-arg">connection</span>,
<span class="summary-sig-arg">field</span>,
<span class="summary-sig-arg">obj</span>)</span><br />
Returns a TIME column as a time object:</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_time">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="web2py.gluon.contrib.pymysql.converters-module.html#convert_timedelta" class="summary-sig-name">convert_timedelta</a>(<span class="summary-sig-arg">connection</span>,
<span class="summary-sig-arg">field</span>,
<span class="summary-sig-arg">obj</span>)</span><br />
Returns a TIME column as a timedelta object:</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_timedelta">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_None"></a><span class="summary-sig-name">escape_None</span>(<span class="summary-sig-arg">value</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_None">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_bool"></a><span class="summary-sig-name">escape_bool</span>(<span class="summary-sig-arg">value</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_bool">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_date"></a><span class="summary-sig-name">escape_date</span>(<span class="summary-sig-arg">obj</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_date">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_datetime"></a><span class="summary-sig-name">escape_datetime</span>(<span class="summary-sig-arg">obj</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_datetime">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_decimal"></a><span class="summary-sig-name">escape_decimal</span>(<span class="summary-sig-arg">obj</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_decimal">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_dict"></a><span class="summary-sig-name">escape_dict</span>(<span class="summary-sig-arg">val</span>,
<span class="summary-sig-arg">charset</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_dict">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_float"></a><span class="summary-sig-name">escape_float</span>(<span class="summary-sig-arg">value</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_float">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_int"></a><span class="summary-sig-name">escape_int</span>(<span class="summary-sig-arg">value</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_object">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_item"></a><span class="summary-sig-name">escape_item</span>(<span class="summary-sig-arg">val</span>,
<span class="summary-sig-arg">charset</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_item">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_long"></a><span class="summary-sig-name">escape_long</span>(<span class="summary-sig-arg">value</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_object">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_object"></a><span class="summary-sig-name">escape_object</span>(<span class="summary-sig-arg">value</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_object">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_sequence"></a><span class="summary-sig-name">escape_sequence</span>(<span class="summary-sig-arg">val</span>,
<span class="summary-sig-arg">charset</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_sequence">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_set"></a><span class="summary-sig-name">escape_set</span>(<span class="summary-sig-arg">val</span>,
<span class="summary-sig-arg">charset</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_set">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_string"></a><span class="summary-sig-name">escape_string</span>(<span class="summary-sig-arg">value</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_string">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_struct_time"></a><span class="summary-sig-name">escape_struct_time</span>(<span class="summary-sig-arg">obj</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_struct_time">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_time"></a><span class="summary-sig-name">escape_time</span>(<span class="summary-sig-arg">obj</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_time">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_timedelta"></a><span class="summary-sig-name">escape_timedelta</span>(<span class="summary-sig-arg">obj</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_timedelta">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="escape_unicode"></a><span class="summary-sig-name">escape_unicode</span>(<span class="summary-sig-arg">value</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#escape_unicode">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Variables</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Variables"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.contrib.pymysql.converters-module.html#ESCAPE_MAP" class="summary-name">ESCAPE_MAP</a> = <code title="{'\x00': '\\0',
'''
''': '\\n',
'\r': '\\r',
'\x1a': '\\Z',
'"': '\\"',
'\'': '\\\'',
'\\': '\\\\'}"><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">\x00</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">\\0</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">\n</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">\\n</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">\r</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">\\r</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">\x1a</code><code class="variable-quote">'</code><code class="variable-op">:</code><code class="variable-ellipsis">...</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a name="ESCAPE_REGEX"></a><span class="summary-name">ESCAPE_REGEX</span> = <code title="re.compile(r'[\x00\n\r\x1a\'"\\]')">re.compile(r'<code class="re-group">[</code>\x00\n\r\x1a\'"\\<code class="re-group">]</code>')</code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.contrib.pymysql.converters-module.html#conversions" class="summary-name">conversions</a> = <code title="{0: <function convert_decimal at 0xd3ccf8>,
1: <function convert_int at 0xd3cb90>,
2: <function convert_int at 0xd3cb90>,
3: <function convert_long at 0xd3cc08>,
4: <function convert_float at 0xd3cc80>,
5: <function convert_float at 0xd3cc80>,
7: <function convert_mysql_timestamp at 0xd3c9b0>,
8: <function convert_long at 0xd3cc08>,
..."><code class="variable-group">{</code>0<code class="variable-op">: </code><function convert_decimal at 0xd3ccf8><code class="variable-op">, </code>1<code class="variable-op">: </code><<code class="variable-ellipsis">...</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.contrib.pymysql.converters-module.html#decoders" class="summary-name">decoders</a> = <code title="{0: <function convert_decimal at 0xd3ccf8>,
1: <function convert_int at 0xd3cb90>,
2: <function convert_int at 0xd3cb90>,
3: <function convert_long at 0xd3cc08>,
4: <function convert_float at 0xd3cc80>,
5: <function convert_float at 0xd3cc80>,
7: <function convert_mysql_timestamp at 0xd3c9b0>,
8: <function convert_long at 0xd3cc08>,
..."><code class="variable-group">{</code>0<code class="variable-op">: </code><function convert_decimal at 0xd3ccf8><code class="variable-op">, </code>1<code class="variable-op">: </code><fun<code class="variable-ellipsis">...</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.contrib.pymysql.converters-module.html#encoders" class="summary-name">encoders</a> = <code title="{<type 'bool'>: <function escape_bool at 0xd3c2a8>,
<type 'float'>: <function escape_float at 0xd3c398>,
<type 'int'>: <function escape_object at 0xd3c320>,
<type 'list'>: <function escape_sequence at 0xd34c80>,
<type 'long'>: <function escape_object at 0xd3c320>,
<type 'dict'>: <function escape_dict at 0xd34a28>,
<type 'NoneType'>: <function escape_None at 0xd3c500>,
<type 'set'>: <function escape_sequence at 0xd34c80>,
..."><code class="variable-group">{</code><type 'bool'><code class="variable-op">: </code><function escape_bool at 0xd3c2a8><code class="variable-op">,</code><code class="variable-ellipsis">...</code></code>
</td>
</tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Function Details</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-FunctionDetails"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
</table>
<a name="convert_date"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">convert_date</span>(<span class="sig-arg">connection</span>,
<span class="sig-arg">field</span>,
<span class="sig-arg">obj</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_date">source code</a></span>
</td>
</table>
Returns a DATE column as a date object:
<pre class="py-doctest">
<span class="py-prompt">>>> </span>date_or_None(<span class="py-string">'2007-02-26'</span>)
<span class="py-output">datetime.date(2007, 2, 26)</span></pre>
Illegal values are returned as None:
<pre class="py-doctest">
<span class="py-prompt">>>> </span>date_or_None(<span class="py-string">'2007-02-31'</span>) <span class="py-keyword">is</span> None
<span class="py-output">True</span>
<span class="py-output"></span><span class="py-prompt">>>> </span>date_or_None(<span class="py-string">'0000-00-00'</span>) <span class="py-keyword">is</span> None
<span class="py-output">True</span></pre>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="convert_datetime"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">convert_datetime</span>(<span class="sig-arg">connection</span>,
<span class="sig-arg">field</span>,
<span class="sig-arg">obj</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_datetime">source code</a></span>
</td>
</table>
Returns a DATETIME or TIMESTAMP column value as a datetime object:
<pre class="py-doctest">
<span class="py-prompt">>>> </span>datetime_or_None(<span class="py-string">'2007-02-25 23:06:20'</span>)
<span class="py-output">datetime.datetime(2007, 2, 25, 23, 6, 20)</span>
<span class="py-output"></span><span class="py-prompt">>>> </span>datetime_or_None(<span class="py-string">'2007-02-25T23:06:20'</span>)
<span class="py-output">datetime.datetime(2007, 2, 25, 23, 6, 20)</span></pre>
Illegal values are returned as None:
<pre class="py-doctest">
<span class="py-prompt">>>> </span>datetime_or_None(<span class="py-string">'2007-02-31T23:06:20'</span>) <span class="py-keyword">is</span> None
<span class="py-output">True</span>
<span class="py-output"></span><span class="py-prompt">>>> </span>datetime_or_None(<span class="py-string">'0000-00-00 00:00:00'</span>) <span class="py-keyword">is</span> None
<span class="py-output">True</span></pre>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="convert_mysql_timestamp"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">convert_mysql_timestamp</span>(<span class="sig-arg">connection</span>,
<span class="sig-arg">field</span>,
<span class="sig-arg">timestamp</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_mysql_timestamp">source code</a></span>
</td>
</table>
<p>Convert a MySQL TIMESTAMP to a Timestamp object.</p>
MySQL >= 4.1 returns TIMESTAMP in the same format as DATETIME:
<pre class="py-doctest">
<span class="py-prompt">>>> </span>mysql_timestamp_converter(<span class="py-string">'2007-02-25 22:32:17'</span>)
<span class="py-output">datetime.datetime(2007, 2, 25, 22, 32, 17)</span></pre>
MySQL < 4.1 uses a big string of numbers:
<pre class="py-doctest">
<span class="py-prompt">>>> </span>mysql_timestamp_converter(<span class="py-string">'20070225223217'</span>)
<span class="py-output">datetime.datetime(2007, 2, 25, 22, 32, 17)</span></pre>
Illegal values are returned as None:
<pre class="py-doctest">
<span class="py-prompt">>>> </span>mysql_timestamp_converter(<span class="py-string">'2007-02-31 22:32:17'</span>) <span class="py-keyword">is</span> None
<span class="py-output">True</span>
<span class="py-output"></span><span class="py-prompt">>>> </span>mysql_timestamp_converter(<span class="py-string">'00000000000000'</span>) <span class="py-keyword">is</span> None
<span class="py-output">True</span></pre>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="convert_time"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">convert_time</span>(<span class="sig-arg">connection</span>,
<span class="sig-arg">field</span>,
<span class="sig-arg">obj</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_time">source code</a></span>
</td>
</table>
Returns a TIME column as a time object:
<pre class="py-doctest">
<span class="py-prompt">>>> </span>time_or_None(<span class="py-string">'15:06:17'</span>)
<span class="py-output">datetime.time(15, 6, 17)</span></pre>
Illegal values are returned as None:
<pre class="py-doctest">
<span class="py-prompt">>>> </span>time_or_None(<span class="py-string">'-25:06:17'</span>) <span class="py-keyword">is</span> None
<span class="py-output">True</span>
<span class="py-output"></span><span class="py-prompt">>>> </span>time_or_None(<span class="py-string">'random crap'</span>) <span class="py-keyword">is</span> None
<span class="py-output">True</span></pre>
<p>Note that MySQL always returns TIME columns as (+|-)HH:MM:SS, but can
accept values as (+|-)DD HH:MM:SS. The latter format will not be parsed
correctly by this function.</p>
Also note that MySQL's TIME column corresponds more closely to
Python's timedelta and not time. However if you want TIME columns to be
treated as time-of-day and not a time offset, then you can use set this
function as the converter for FIELD_TYPE.TIME.
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="convert_timedelta"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">convert_timedelta</span>(<span class="sig-arg">connection</span>,
<span class="sig-arg">field</span>,
<span class="sig-arg">obj</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.contrib.pymysql.converters-pysrc.html#convert_timedelta">source code</a></span>
</td>
</table>
Returns a TIME column as a timedelta object:
<pre class="py-doctest">
<span class="py-prompt">>>> </span>timedelta_or_None(<span class="py-string">'25:06:17'</span>)
<span class="py-output">datetime.timedelta(1, 3977)</span>
<span class="py-output"></span><span class="py-prompt">>>> </span>timedelta_or_None(<span class="py-string">'-25:06:17'</span>)
<span class="py-output">datetime.timedelta(-2, 83177)</span></pre>
Illegal values are returned as None:
<pre class="py-doctest">
<span class="py-prompt">>>> </span>timedelta_or_None(<span class="py-string">'random crap'</span>) <span class="py-keyword">is</span> None
<span class="py-output">True</span></pre>
Note that MySQL always returns TIME columns as (+|-)HH:MM:SS, but can
accept values as (+|-)DD HH:MM:SS. The latter format will not be parsed
correctly by this function.
<dl class="fields">
</dl>
</td></tr></table>
</div>
<br />
<!-- ==================== VARIABLES DETAILS ==================== -->
<a name="section-VariablesDetails"></a>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Variables Details</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-VariablesDetails"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
</table>
<a name="ESCAPE_MAP"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">ESCAPE_MAP</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
<code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">\x00</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">\\0</code><code class="variable-quote">'</code><code class="variable-op">,</code>
<code class="variable-quote">'''</code><code class="variable-string"></code>
<code class="variable-string"></code><code class="variable-quote">'''</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">\\n</code><code class="variable-quote">'</code><code class="variable-op">,</code>
<code class="variable-quote">'</code><code class="variable-string">\r</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">\\r</code><code class="variable-quote">'</code><code class="variable-op">,</code>
<code class="variable-quote">'</code><code class="variable-string">\x1a</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">\\Z</code><code class="variable-quote">'</code><code class="variable-op">,</code>
<code class="variable-quote">'</code><code class="variable-string">"</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">\\"</code><code class="variable-quote">'</code><code class="variable-op">,</code>
<code class="variable-quote">'</code><code class="variable-string">\'</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">\\\'</code><code class="variable-quote">'</code><code class="variable-op">,</code>
<code class="variable-quote">'</code><code class="variable-string">\\</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">\\\\</code><code class="variable-quote">'</code><code class="variable-group">}</code>
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<a name="conversions"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">conversions</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
<code class="variable-group">{</code>0<code class="variable-op">: </code><function convert_decimal at 0xd3ccf8><code class="variable-op">,</code>
1<code class="variable-op">: </code><function convert_int at 0xd3cb90><code class="variable-op">,</code>
2<code class="variable-op">: </code><function convert_int at 0xd3cb90><code class="variable-op">,</code>
3<code class="variable-op">: </code><function convert_long at 0xd3cc08><code class="variable-op">,</code>
4<code class="variable-op">: </code><function convert_float at 0xd3cc80><code class="variable-op">,</code>
5<code class="variable-op">: </code><function convert_float at 0xd3cc80><code class="variable-op">,</code>
7<code class="variable-op">: </code><function convert_mysql_timestamp at 0xd3c9b0><code class="variable-op">,</code>
8<code class="variable-op">: </code><function convert_long at 0xd3cc08><code class="variable-op">,</code>
<code class="variable-ellipsis">...</code>
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<a name="decoders"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">decoders</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
<code class="variable-group">{</code>0<code class="variable-op">: </code><function convert_decimal at 0xd3ccf8><code class="variable-op">,</code>
1<code class="variable-op">: </code><function convert_int at 0xd3cb90><code class="variable-op">,</code>
2<code class="variable-op">: </code><function convert_int at 0xd3cb90><code class="variable-op">,</code>
3<code class="variable-op">: </code><function convert_long at 0xd3cc08><code class="variable-op">,</code>
4<code class="variable-op">: </code><function convert_float at 0xd3cc80><code class="variable-op">,</code>
5<code class="variable-op">: </code><function convert_float at 0xd3cc80><code class="variable-op">,</code>
7<code class="variable-op">: </code><function convert_mysql_timestamp at 0xd3c9b0><code class="variable-op">,</code>
8<code class="variable-op">: </code><function convert_long at 0xd3cc08><code class="variable-op">,</code>
<code class="variable-ellipsis">...</code>
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<a name="encoders"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">encoders</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
<code class="variable-group">{</code><type 'bool'><code class="variable-op">: </code><function escape_bool at 0xd3c2a8><code class="variable-op">,</code>
<type 'float'><code class="variable-op">: </code><function escape_float at 0xd3c398><code class="variable-op">,</code>
<type 'int'><code class="variable-op">: </code><function escape_object at 0xd3c320><code class="variable-op">,</code>
<type 'list'><code class="variable-op">: </code><function escape_sequence at 0xd34c80><code class="variable-op">,</code>
<type 'long'><code class="variable-op">: </code><function escape_object at 0xd3c320><code class="variable-op">,</code>
<type 'dict'><code class="variable-op">: </code><function escape_dict at 0xd34a28><code class="variable-op">,</code>
<type 'NoneType'><code class="variable-op">: </code><function escape_None at 0xd3c500><code class="variable-op">,</code>
<type 'set'><code class="variable-op">: </code><function escape_sequence at 0xd34c80><code class="variable-op">,</code>
<code class="variable-ellipsis">...</code>
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="web2py.gluon-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.web2py.com">web2py Web Framework</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0beta1 on Thu Aug 4 00:46:59 2011
</td>
<td align="right" class="footer">
<a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie()
// -->
</script>
</body>
</html>