<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <h1 class="pudge-member-page-heading"> <tt>DatabaseIndex</tt> </h1> <h4 class="pudge-member-page-subheading"> This takes a variable number of parameters, each of which is a column for indexing. Each column may be a column object or the string name of the column (<em>not</em> the database name). You may also use dictionaries, to further customize the indexing of the column. The dictionary may have certain keys: </h4> <p class="pudge-member-parent-link"> <small> The DatabaseIndex class is accessible via the <a href="module-sqlobject.index.html"> <tt>sqlobject.index</tt> </a> module. </small> </p> <div id="pudge-section-nav"> <ul> <li> <a href="#attributes" class="pudge-section-link"> Attributes (1) </a> </li><li> <a href="#methods" class="pudge-section-link"> Methods (6) </a> </li> <li> <a href="sqlobject/index.py.html?f=127&l=179#127" class="pudge-section-link"> Source </a> </li> </ul> </div> <div style="clear: left"></div> <div class="rst pudge-module-doc"> <dl class="docutils"> <dt>'column':</dt> <dd>The column object or string identifier.</dd> <dt>'length':</dt> <dd>MySQL will only index the first N characters if this is given. For other databases this is ignored.</dd> <dt>'expression':</dt> <dd>You can create an index based on an expression, e.g., 'lower(column)'. This can either be a string or a sqlbuilder expression.</dd> </dl> <p>Further keys may be added to the column specs in the future.</p> <p>The class also take the keyword argument <cite>unique</cite> ; if true then a UNIQUE index is created.</p> </div> <hr> <a name="attributes"></a> <h2>Attributes</h2> <div class="pudge-member name"> <a name="name"></a> <h4 class="pudge-member-name"><span class="prefix">a</span> <tt><a href="class-sqlobject.index.DatabaseIndex.html#name" class="pudge-obj-link">name</a></tt></h4> <div class="pudge-section rst"> <pre><property object at 0xadfe61c></pre> </div> </div> <a name="methods"></a> <h2>Methods</h2> <div class="pudge-member routine alias"> <a name="__format__"></a> <h4 class="pudge-member-name"><span class="prefix">f</span> <tt><a href="class-sqlobject.index.DatabaseIndex.html#__format__" class="pudge-obj-link">__format__</a>(...)</tt> <a href="__builtin__.py.html" title="View Source">...</a> </h4> <div class="pudge-section rst"> <p class="pudge-member-blurb"> default object formatter </p> </div> </div><div class="pudge-member routine alias"> <a name="__subclasshook__"></a> <h4 class="pudge-member-name"><span class="prefix">f</span> <tt><a href="class-sqlobject.index.DatabaseIndex.html#__subclasshook__" class="pudge-obj-link">__subclasshook__</a>(...)</tt> <a href="None.html" title="View Source">...</a> </h4> <div class="pudge-section rst"> <p class="pudge-member-blurb"> Abstract classes can override this to customize issubclass(). </p> <p>This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).</p> </div> </div><div class="pudge-member routine alias"> <a name="__sizeof__"></a> <h4 class="pudge-member-name"><span class="prefix">f</span> <tt><a href="class-sqlobject.index.DatabaseIndex.html#__sizeof__" class="pudge-obj-link">__sizeof__</a>(...)</tt> <a href="__builtin__.py.html" title="View Source">...</a> </h4> <div class="pudge-section rst"> <p class="pudge-member-blurb"> __sizeof__() -> int size of object in memory, in bytes </p> </div> </div><div class="pudge-member routine "> <a name="__init__"></a> <h4 class="pudge-member-name"><span class="prefix">f</span> <tt><a href="class-sqlobject.index.DatabaseIndex.html#__init__" class="pudge-obj-link">__init__</a>(self, *columns, **kw)</tt> <a href="sqlobject/index.py.html?f=153&l=157#153" title="View Source">...</a> </h4> <div class="pudge-section rst"> </div> </div><div class="pudge-member routine "> <a name="setName"></a> <h4 class="pudge-member-name"><span class="prefix">f</span> <tt><a href="class-sqlobject.index.DatabaseIndex.html#setName" class="pudge-obj-link">setName</a>(self, value)</tt> <a href="sqlobject/index.py.html?f=158&l=161#158" title="View Source">...</a> </h4> <div class="pudge-section rst"> </div> </div><div class="pudge-member routine "> <a name="withClass"></a> <h4 class="pudge-member-name"><span class="prefix">f</span> <tt><a href="class-sqlobject.index.DatabaseIndex.html#withClass" class="pudge-obj-link">withClass</a>(self, soClass)</tt> <a href="sqlobject/index.py.html?f=170&l=173#170" title="View Source">...</a> </h4> <div class="pudge-section rst"> </div> </div> <p> <small> See <a href="sqlobject/index.py.html?f=127&l=179#127" title="sqlobject/index.py:127">the source</a> for more information. </small> </p>