<?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.dal.Table</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> ::
<a href="web2py.gluon.dal-module.html">Module dal</a> ::
Class Table
</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.dal.Table-class.html"
target="_top">no frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Table</h1><span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table">source code</a></span><br /><br />
<pre class="base-tree">
object --+
|
dict --+
|
<strong class="uidshort">Table</strong>
</pre>
<hr />
<p>an instance of this class represents a database table</p>
Example:
<pre class="literalblock">
db = DAL(...)
db.define_table('users', Field('name'))
db.users.insert(name='me') # print db.users._insert(...) to see SQL
db.users.drop()
</pre><br /><br />
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></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">Instance Methods</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-InstanceMethods"
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 href="web2py.gluon.dal.Table-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">db</span>,
<span class="summary-sig-arg">tablename</span>,
<span class="summary-sig-arg">*fields</span>,
<span class="summary-sig-arg">**args</span>)</span><br />
Initializes the table and performs checking on the provided
fields.</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__init__">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<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="_validate"></a><span class="summary-sig-name">_validate</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">**vars</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table._validate">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<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="_create_references"></a><span class="summary-sig-name">_create_references</span>(<span class="summary-sig-arg">self</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table._create_references">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<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="_filter_fields"></a><span class="summary-sig-name">_filter_fields</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">record</span>,
<span class="summary-sig-arg">id</span>=<span class="summary-sig-default">True</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table._filter_fields">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<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="_build_query"></a><span class="summary-sig-name">_build_query</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">key</span>)</span><br />
for keyed table only</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table._build_query">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.dal.Table-class.html#__getitem__" class="summary-sig-name">__getitem__</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">key</span>)</span><br />
x[y]</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__getitem__">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="__call__"></a><span class="summary-sig-name">__call__</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">key</span>=<span class="summary-sig-default"><function <lambda> at 0xd1ec80></span>,
<span class="summary-sig-arg">**kwargs</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__call__">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.dal.Table-class.html#__setitem__" class="summary-sig-name">__setitem__</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">key</span>,
<span class="summary-sig-arg">value</span>)</span><br />
x[i]=y</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__setitem__">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.dal.Table-class.html#__delitem__" class="summary-sig-name">__delitem__</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">key</span>)</span><br />
del x[y]</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__delitem__">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="__getattr__"></a><span class="summary-sig-name">__getattr__</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">key</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__getattr__">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.dal.Table-class.html#__setattr__" class="summary-sig-name">__setattr__</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">key</span>,
<span class="summary-sig-arg">value</span>)</span><br />
x.__setattr__('name', value) <==> x.name = value</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__setattr__">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.dal.Table-class.html#__iter__" class="summary-sig-name">__iter__</a>(<span class="summary-sig-arg">self</span>)</span><br />
iter(x)</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__iter__">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.dal.Table-class.html#__repr__" class="summary-sig-name">__repr__</a>(<span class="summary-sig-arg">self</span>)</span><br />
repr(x)</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__repr__">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.dal.Table-class.html#__str__" class="summary-sig-name">__str__</a>(<span class="summary-sig-arg">self</span>)</span><br />
str(x)</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__str__">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<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="_drop"></a><span class="summary-sig-name">_drop</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">mode</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table._drop">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="drop"></a><span class="summary-sig-name">drop</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">mode</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.drop">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<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="_listify"></a><span class="summary-sig-name">_listify</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">fields</span>,
<span class="summary-sig-arg">update</span>=<span class="summary-sig-default">True</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table._listify">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<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="_insert"></a><span class="summary-sig-name">_insert</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">**fields</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table._insert">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="insert"></a><span class="summary-sig-name">insert</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">**fields</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.insert">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="validate_and_insert"></a><span class="summary-sig-name">validate_and_insert</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">**fields</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.validate_and_insert">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="update_or_insert"></a><span class="summary-sig-name">update_or_insert</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">key</span>=<span class="summary-sig-default"><function <lambda> at 0xd1ec80></span>,
<span class="summary-sig-arg">**values</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.update_or_insert">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="bulk_insert"></a><span class="summary-sig-name">bulk_insert</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">items</span>)</span><br />
here items is a list of dictionaries</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.bulk_insert">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<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="_truncate"></a><span class="summary-sig-name">_truncate</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">mode</span>=<span class="summary-sig-default">1</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table._truncate">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="truncate"></a><span class="summary-sig-name">truncate</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">mode</span>=<span class="summary-sig-default">1</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.truncate">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.dal.Table-class.html#import_from_csv_file" class="summary-sig-name">import_from_csv_file</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">csvfile</span>,
<span class="summary-sig-arg">id_map</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">null</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"><NULL></code><code class="variable-quote">'</code></span>,
<span class="summary-sig-arg">unique</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">uuid</code><code class="variable-quote">'</code></span>,
<span class="summary-sig-arg">*args</span>,
<span class="summary-sig-arg">**kwargs</span>)</span><br />
import records from csv file.</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.import_from_csv_file">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="with_alias"></a><span class="summary-sig-name">with_alias</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">alias</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.with_alias">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="on"></a><span class="summary-sig-name">on</span>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">query</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.on">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" class="summary">
<p class="indent-wrapped-lines"><b>Inherited from <code>dict</code></b>:
<code>__cmp__</code>,
<code>__contains__</code>,
<code>__eq__</code>,
<code>__ge__</code>,
<code>__getattribute__</code>,
<code>__gt__</code>,
<code>__hash__</code>,
<code>__le__</code>,
<code>__len__</code>,
<code>__lt__</code>,
<code>__ne__</code>,
<code>__new__</code>,
<code>clear</code>,
<code>copy</code>,
<code>fromkeys</code>,
<code>get</code>,
<code>has_key</code>,
<code>items</code>,
<code>iteritems</code>,
<code>iterkeys</code>,
<code>itervalues</code>,
<code>keys</code>,
<code>pop</code>,
<code>popitem</code>,
<code>setdefault</code>,
<code>update</code>,
<code>values</code>
</p>
<p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
<code>__delattr__</code>,
<code>__reduce__</code>,
<code>__reduce_ex__</code>
</p>
</td>
</tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></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">Properties</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Properties"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" class="summary">
<p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
<code>__class__</code>
</p>
</td>
</tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></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">Method Details</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-MethodDetails"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
</table>
<a name="__init__"></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">__init__</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">db</span>,
<span class="sig-arg">tablename</span>,
<span class="sig-arg">*fields</span>,
<span class="sig-arg">**args</span>)</span>
<br /><em class="fname">(Constructor)</em>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__init__">source code</a></span>
</td>
</table>
<p>Initializes the table and performs checking on the provided
fields.</p>
<p>Each table will have automatically an 'id'.</p>
<p>If a field is of type Table, the fields (excluding 'id') from that
table will be used instead.</p>
:raises SyntaxError: when a supplied field is of incorrect type.
<dl class="fields">
<dt>Returns:</dt>
<dd><pre class="literalblock">
new empty dictionary
</pre></dd>
<dt>Overrides:
dict.__init__
</dt>
</dl>
</td></tr></table>
</div>
<a name="__getitem__"></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">__getitem__</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">key</span>)</span>
<br /><em class="fname">(Indexing operator)</em>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__getitem__">source code</a></span>
</td>
</table>
x[y]
<dl class="fields">
<dt>Overrides:
dict.__getitem__
<dd><em class="note">(inherited documentation)</em></dd>
</dt>
</dl>
</td></tr></table>
</div>
<a name="__setitem__"></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">__setitem__</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">key</span>,
<span class="sig-arg">value</span>)</span>
<br /><em class="fname">(Index assignment operator)</em>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__setitem__">source code</a></span>
</td>
</table>
x[i]=y
<dl class="fields">
<dt>Overrides:
dict.__setitem__
<dd><em class="note">(inherited documentation)</em></dd>
</dt>
</dl>
</td></tr></table>
</div>
<a name="__delitem__"></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">__delitem__</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">key</span>)</span>
<br /><em class="fname">(Index deletion operator)</em>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__delitem__">source code</a></span>
</td>
</table>
del x[y]
<dl class="fields">
<dt>Overrides:
dict.__delitem__
<dd><em class="note">(inherited documentation)</em></dd>
</dt>
</dl>
</td></tr></table>
</div>
<a name="__setattr__"></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">__setattr__</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">key</span>,
<span class="sig-arg">value</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__setattr__">source code</a></span>
</td>
</table>
x.__setattr__('name', value) <==> x.name = value
<dl class="fields">
<dt>Overrides:
object.__setattr__
<dd><em class="note">(inherited documentation)</em></dd>
</dt>
</dl>
</td></tr></table>
</div>
<a name="__iter__"></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">__iter__</span>(<span class="sig-arg">self</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__iter__">source code</a></span>
</td>
</table>
iter(x)
<dl class="fields">
<dt>Overrides:
dict.__iter__
<dd><em class="note">(inherited documentation)</em></dd>
</dt>
</dl>
</td></tr></table>
</div>
<a name="__repr__"></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">__repr__</span>(<span class="sig-arg">self</span>)</span>
<br /><em class="fname">(Representation operator)</em>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__repr__">source code</a></span>
</td>
</table>
repr(x)
<dl class="fields">
<dt>Overrides:
dict.__repr__
<dd><em class="note">(inherited documentation)</em></dd>
</dt>
</dl>
</td></tr></table>
</div>
<a name="__str__"></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">__str__</span>(<span class="sig-arg">self</span>)</span>
<br /><em class="fname">(Informal representation operator)</em>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.__str__">source code</a></span>
</td>
</table>
str(x)
<dl class="fields">
<dt>Overrides:
object.__str__
<dd><em class="note">(inherited documentation)</em></dd>
</dt>
</dl>
</td></tr></table>
</div>
<a name="import_from_csv_file"></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">import_from_csv_file</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">csvfile</span>,
<span class="sig-arg">id_map</span>=<span class="sig-default">1</span>,
<span class="sig-arg">null</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string"><NULL></code><code class="variable-quote">'</code></span>,
<span class="sig-arg">unique</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">uuid</code><code class="variable-quote">'</code></span>,
<span class="sig-arg">*args</span>,
<span class="sig-arg">**kwargs</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.dal-pysrc.html#Table.import_from_csv_file">source code</a></span>
</td>
</table>
import records from csv file. Column headers must have same names as
table fields. field 'id' is ignored. If column names read 'table.file'
the 'table.' prefix is ignored. 'unique' argument is a field which must
be unique (typically a uuid field)
<dl class="fields">
</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:47:00 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>