Update of /cvsroot/sqlobject/SOWeb/docs
In directory sc8-pr-cvs1:/tmp/cvs-serv22271/docs
Modified Files:
News.html News.txt SQLObject.html SQLObject.txt build
default.css
Log Message:
Update for 0.4
Index: News.html
===================================================================
RCS file: /cvsroot/sqlobject/SOWeb/docs/News.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** News.html 8 Apr 2003 04:05:04 -0000 1.2
--- News.html 5 Jul 2003 04:39:07 -0000 1.3
***************
*** 14,33 ****
<p class="topic-title"><a name="contents">Contents:</a></p>
<ul class="simple">
! <li><a class="reference" href="#sqlobject-0-3" id="id3" name="id3">SQLObject 0.3</a><ul>
! <li><a class="reference" href="#features" id="id4" name="id4">Features</a></li>
! <li><a class="reference" href="#bugs" id="id5" name="id5">Bugs</a></li>
</ul>
</li>
! <li><a class="reference" href="#sqlobject-0-2-1" id="id6" name="id6">SQLObject 0.2.1</a><ul>
! <li><a class="reference" href="#id1" id="id7" name="id7">Bugs</a></li>
! <li><a class="reference" href="#id2" id="id8" name="id8">Features</a></li>
</ul>
</li>
</ul>
</div>
! <a class="target" id="start" name="start"></a><div class="section" id="sqlobject-0-3">
! <h1><a name="sqlobject-0-3">SQLObject 0.3</a></h1>
<div class="section" id="features">
<h2><a name="features">Features</a></h2>
<ul class="simple">
<li>Table creation (SQL schema generation) via new class method
--- 14,170 ----
<p class="topic-title"><a name="contents">Contents:</a></p>
<ul class="simple">
! <li><a class="reference" href="#sqlobject-0-4" id="id5" name="id5">SQLObject 0.4</a><ul>
! <li><a class="reference" href="#features" id="id6" name="id6">Features</a><ul>
! <li><a class="reference" href="#col-and-join" id="id7" name="id7">Col and Join</a></li>
</ul>
</li>
! <li><a class="reference" href="#bugs" id="id8" name="id8">Bugs</a></li>
! <li><a class="reference" href="#internal" id="id9" name="id9">Internal</a></li>
! </ul>
! </li>
! <li><a class="reference" href="#sqlobject-0-3" id="id10" name="id10">SQLObject 0.3</a><ul>
! <li><a class="reference" href="#id1" id="id11" name="id11">Features</a></li>
! <li><a class="reference" href="#id2" id="id12" name="id12">Bugs</a></li>
! </ul>
! </li>
! <li><a class="reference" href="#sqlobject-0-2-1" id="id13" name="id13">SQLObject 0.2.1</a><ul>
! <li><a class="reference" href="#id3" id="id14" name="id14">Bugs</a></li>
! <li><a class="reference" href="#id4" id="id15" name="id15">Features</a></li>
</ul>
</li>
</ul>
</div>
! <a class="target" id="start" name="start"></a><div class="section" id="sqlobject-0-4">
! <h1><a name="sqlobject-0-4">SQLObject 0.4</a></h1>
<div class="section" id="features">
<h2><a name="features">Features</a></h2>
+ <ul>
+ <li><p class="first">You can specify columns in a new, preferred manner:</p>
+ <pre class="literal-block">
+ class SomeObject(SQLObject):
+ someColumn = Col()
+ </pre>
+ <p>Equivalent to:</p>
+ <pre class="literal-block">
+ class SomeObject(SQLObject):
+ _columns = [Col('someColumn')]
+ </pre>
+ <p>Ditto joins.</p>
+ </li>
+ <li><p class="first">Cache objects have a clear method, which empties all objects.
+ However, weak references to objects <em>are</em> maintained, so the
+ integrity of the cache can be ensured.</p>
+ </li>
+ <li><p class="first">SQLObject subclasses can be further subclassed, adding or removing
+ column definitions (as well as changing settings like connection,
+ style, etc). Each class still refers to a single concrete table in
+ the database -- the class hierarchy is not represented in the
+ database.</p>
+ </li>
+ <li><p class="first">Each SQLObject subclass can have an associated style, as given in
+ the <cite>_style</cite> attribute. This object is used to map between Python
+ and database names (e.g., the column name for a Python attribute).
+ Some samples are available in the <cite>Style</cite> module.</p>
+ </li>
+ <li><p class="first">Postgres support for <cite>_fromDatabase</cite> (reading a table definition from
+ the database, and creating a class from that).</p>
+ </li>
+ <li><p class="first">Postgres id columns more permissive, you don't have to create a
+ specially named sequence (or implicitly create that sequence through
+ <tt class="literal"><span class="pre">SERIAL</span></tt>). lastoid is used instead.</p>
+ </li>
+ <li><p class="first">MySQL uses <tt class="literal"><span class="pre">localhost</span></tt> as the default host, and the empty string
+ as the default password.</p>
+ </li>
+ <li><p class="first">Added functions for use with queries: <cite>ISNULL</cite>, <cite>ISNOTNULL</cite>. <tt class="literal"><span class="pre">==</span></tt>
+ and <tt class="literal"><span class="pre">!=</span></tt> can be used with None, and is translated into <cite>ISNULL</cite>,
+ <cite>ISNOTNULL</cite>.</p>
+ </li>
+ <li><p class="first">Classes can be part of a specific registry. Since classes are
+ referred to by name in several places, the names have to be unique.
+ This can be problematic, so you can add a class variable <cite>_registry</cite>,
+ the value of which should be a string. Classes references are
+ assumed to be inside that registry, and class names need only be
+ unique among classes in that registry.</p>
+ </li>
+ <li><p class="first"><tt class="literal"><span class="pre">SomeClass.select()</span></tt> selects all, instead of using
+ <tt class="literal"><span class="pre">SomeClass.select('all')</span></tt>. You can also use None instead of
+ <tt class="literal"><span class="pre">'all'</span></tt>.</p>
+ </li>
+ <li><p class="first">Trying to fetch non-existent objects raises <cite>SQLObjectNotFound</cite>,
+ which is a subclass of the builtin exception <cite>LookupError</cite>.
+ This may not be raised if <cite>_cacheValues</cite> is False and you use
+ the ID to fetch an object (but alternateID fetches will raise
+ the exception in either case).</p>
+ </li>
+ <li><p class="first">Can order by descending order, with the <cite>reversed</cite> option to
+ the <cite>select</cite> method, or by prefixing the column with a <tt class="literal"><span class="pre">"-"</span></tt>.</p>
+ </li>
+ <li><p class="first">Ordering with joins works better -- you can order with multiple
+ columns, as well as descending ordering.</p>
+ </li>
+ </ul>
+ <div class="section" id="col-and-join">
+ <h3><a name="col-and-join">Col and Join</a></h3>
+ <ul class="simple">
+ <li><cite>Join</cite> constructors have an argument <cite>orderBy</cite>, which is the name
+ of a Python attribute to sort results by. If not given, the
+ appropriate class's <cite>_defaultOrder</cite> will be used. None implies
+ no sorting (and <tt class="literal"><span class="pre">orderBy=None</span></tt> will override <cite>_defaultOrder</cite>).</li>
+ <li><cite>ForeignKey</cite> class (subclass of <cite>Col</cite>), for somewhat easier/clearer
+ declaration of foreign keys.</li>
+ <li><cite>Col</cite> (and subclasses) can take a <cite>sqlType</cite> argument, which is used
+ in table definitions. E.g., <tt class="literal"><span class="pre">Col(sqlType="BOOLEAN")</span></tt> can be used
+ to create a <tt class="literal"><span class="pre">BOOLEAN</span></tt> column, even though no <cite>BooleanCol</cite> exists.</li>
+ <li><cite>alternateID</cite> (a specifier for columns) implies <tt class="literal"><span class="pre">NOT</span> <span class="pre">NULL</span></tt>. Also
+ implies <tt class="literal"><span class="pre">UNIQUE</span></tt>.</li>
+ <li><cite>unique</cite> (a specifier for columns) added.</li>
+ <li><cite>DecimalCol</cite> and <cite>CurrencyCol</cite> added.</li>
+ <li><cite>EnumCol</cite> uses constraints on Postgres (if you use <cite>createTable</cite>).</li>
+ </ul>
+ </div>
+ </div>
+ <div class="section" id="bugs">
+ <h2><a name="bugs">Bugs</a></h2>
+ <ul class="simple">
+ <li><cite>DateTimeCol</cite> uses <tt class="literal"><span class="pre">TIMESTAMP</span></tt> for Postgres. Note that the
+ Python type name is used for column names, not necessarily the
+ SQL standard name.</li>
+ <li>Foreign key column names are slightly more permissive. They still
+ need to end in <tt class="literal"><span class="pre">id</span></tt>, but it's case insensitive.</li>
+ <li>_defaultOrder should be the python attribute's name, not the database
+ name.</li>
+ <li>SomeClass.q.colName uses proper Python attributes for colName, and
+ proper database names when executed in the database.</li>
+ <li>SQLite select results back to being proper iterator.</li>
+ <li>SomeClass.q.colName now does proper translation to database names,
+ using dbName, etc., instead of being entirely algorithm-driven.</li>
+ <li>Raise <cite>TypeError</cite> if you pass an unknown argument to the <cite>new</cite>
+ method.</li>
+ <li>You can override the _get_* or _set_* version of a property without
+ overriding the other.</li>
+ <li>Python 2.3 compatible.</li>
+ <li>Trying to use <tt class="literal"><span class="pre">Col('id')</span></tt> or <tt class="literal"><span class="pre">id</span> <span class="pre">=</span> <span class="pre">Col()</span></tt> will raise an
+ exception, instead of just acting funky.</li>
+ <li><tt class="literal"><span class="pre">ForeignKey</span></tt> columns return None if the associated column is
+ NULL in the database (used to just act weird).</li>
+ <li>Instantiating an object with an id of None will give an error,
+ instead of just acting weird.</li>
+ </ul>
+ </div>
+ <div class="section" id="internal">
+ <h2><a name="internal">Internal</a></h2>
+ <ul class="simple">
+ <li><cite>Col</cite> class separated into <cite>Col</cite> and <cite>SOCol</cite> (and same for all other
+ <cite>*Col</cite> classes). <cite>Col</cite> defines a column, <cite>SOCol</cite> is that definition
+ bound to a particular SQLObject class.</li>
+ <li>Instance variable <tt class="literal"><span class="pre">_SO_columns</span></tt> holds the <cite>SOCol</cite> instances.</li>
+ </ul>
+ </div>
+ </div>
+ <div class="section" id="sqlobject-0-3">
+ <h1><a name="sqlobject-0-3">SQLObject 0.3</a></h1>
+ <div class="section" id="id1">
+ <h2><a name="id1">Features</a></h2>
<ul class="simple">
<li>Table creation (SQL schema generation) via new class method
***************
*** 56,61 ****
</ul>
</div>
! <div class="section" id="bugs">
! <h2><a name="bugs">Bugs</a></h2>
<ul class="simple">
<li>LIMIT/OFFSET (select result slicing) works in Postgres and SQLite.</li>
--- 193,198 ----
</ul>
</div>
! <div class="section" id="id2">
! <h2><a name="id2">Bugs</a></h2>
<ul class="simple">
<li>LIMIT/OFFSET (select result slicing) works in Postgres and SQLite.</li>
***************
*** 68,79 ****
<div class="section" id="sqlobject-0-2-1">
<h1><a name="sqlobject-0-2-1">SQLObject 0.2.1</a></h1>
! <div class="section" id="id1">
! <h2><a name="id1">Bugs</a></h2>
<ul class="simple">
<li>Fixed caching of new objects</li>
</ul>
</div>
! <div class="section" id="id2">
! <h2><a name="id2">Features</a></h2>
<ul class="simple">
<li><a class="reference" href="http://sqlite.org/">SQLite</a> support</li>
--- 205,216 ----
<div class="section" id="sqlobject-0-2-1">
<h1><a name="sqlobject-0-2-1">SQLObject 0.2.1</a></h1>
! <div class="section" id="id3">
! <h2><a name="id3">Bugs</a></h2>
<ul class="simple">
<li>Fixed caching of new objects</li>
</ul>
</div>
! <div class="section" id="id4">
! <h2><a name="id4">Features</a></h2>
<ul class="simple">
<li><a class="reference" href="http://sqlite.org/">SQLite</a> support</li>
Index: News.txt
===================================================================
RCS file: /cvsroot/sqlobject/SOWeb/docs/News.txt,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** News.txt 8 Apr 2003 04:05:04 -0000 1.2
--- News.txt 5 Jul 2003 04:39:07 -0000 1.3
***************
*** 8,11 ****
--- 8,152 ----
.. _start:
+ SQLObject 0.4
+ =============
+
+ Features
+ --------
+
+ * You can specify columns in a new, preferred manner::
+
+ class SomeObject(SQLObject):
+ someColumn = Col()
+
+ Equivalent to::
+
+ class SomeObject(SQLObject):
+ _columns = [Col('someColumn')]
+
+ Ditto joins.
+
+ * Cache objects have a clear method, which empties all objects.
+ However, weak references to objects *are* maintained, so the
+ integrity of the cache can be ensured.
+
+ * SQLObject subclasses can be further subclassed, adding or removing
+ column definitions (as well as changing settings like connection,
+ style, etc). Each class still refers to a single concrete table in
+ the database -- the class hierarchy is not represented in the
+ database.
+
+ * Each SQLObject subclass can have an associated style, as given in
+ the `_style` attribute. This object is used to map between Python
+ and database names (e.g., the column name for a Python attribute).
+ Some samples are available in the `Style` module.
+
+ * Postgres support for `_fromDatabase` (reading a table definition from
+ the database, and creating a class from that).
+
+ * Postgres id columns more permissive, you don't have to create a
+ specially named sequence (or implicitly create that sequence through
+ ``SERIAL``). lastoid is used instead.
+
+ * MySQL uses ``localhost`` as the default host, and the empty string
+ as the default password.
+
+ * Added functions for use with queries: `ISNULL`, `ISNOTNULL`. ``==``
+ and ``!=`` can be used with None, and is translated into `ISNULL`,
+ `ISNOTNULL`.
+
+ * Classes can be part of a specific registry. Since classes are
+ referred to by name in several places, the names have to be unique.
+ This can be problematic, so you can add a class variable `_registry`,
+ the value of which should be a string. Classes references are
+ assumed to be inside that registry, and class names need only be
+ unique among classes in that registry.
+
+ * ``SomeClass.select()`` selects all, instead of using
+ ``SomeClass.select('all')``. You can also use None instead of
+ ``'all'``.
+
+ * Trying to fetch non-existent objects raises `SQLObjectNotFound`,
+ which is a subclass of the builtin exception `LookupError`.
+ This may not be raised if `_cacheValues` is False and you use
+ the ID to fetch an object (but alternateID fetches will raise
+ the exception in either case).
+
+ * Can order by descending order, with the `reversed` option to
+ the `select` method, or by prefixing the column with a ``"-"``.
+
+ * Ordering with joins works better -- you can order with multiple
+ columns, as well as descending ordering.
+
+ Col and Join
+ ~~~~~~~~~~~~
+
+ * `Join` constructors have an argument `orderBy`, which is the name
+ of a Python attribute to sort results by. If not given, the
+ appropriate class's `_defaultOrder` will be used. None implies
+ no sorting (and ``orderBy=None`` will override `_defaultOrder`).
+
+ * `ForeignKey` class (subclass of `Col`), for somewhat easier/clearer
+ declaration of foreign keys.
+
+ * `Col` (and subclasses) can take a `sqlType` argument, which is used
+ in table definitions. E.g., ``Col(sqlType="BOOLEAN")`` can be used
+ to create a ``BOOLEAN`` column, even though no `BooleanCol` exists.
+
+ * `alternateID` (a specifier for columns) implies ``NOT NULL``. Also
+ implies ``UNIQUE``.
+
+ * `unique` (a specifier for columns) added.
+
+ * `DecimalCol` and `CurrencyCol` added.
+
+ * `EnumCol` uses constraints on Postgres (if you use `createTable`).
+
+ Bugs
+ ----
+
+ * `DateTimeCol` uses ``TIMESTAMP`` for Postgres. Note that the
+ Python type name is used for column names, not necessarily the
+ SQL standard name.
+
+ * Foreign key column names are slightly more permissive. They still
+ need to end in ``id``, but it's case insensitive.
+
+ * _defaultOrder should be the python attribute's name, not the database
+ name.
+
+ * SomeClass.q.colName uses proper Python attributes for colName, and
+ proper database names when executed in the database.
+
+ * SQLite select results back to being proper iterator.
+
+ * SomeClass.q.colName now does proper translation to database names,
+ using dbName, etc., instead of being entirely algorithm-driven.
+
+ * Raise `TypeError` if you pass an unknown argument to the `new`
+ method.
+
+ * You can override the _get_* or _set_* version of a property without
+ overriding the other.
+
+ * Python 2.3 compatible.
+
+ * Trying to use ``Col('id')`` or ``id = Col()`` will raise an
+ exception, instead of just acting funky.
+
+ * ``ForeignKey`` columns return None if the associated column is
+ NULL in the database (used to just act weird).
+
+ * Instantiating an object with an id of None will give an error,
+ instead of just acting weird.
+
+ Internal
+ --------
+
+ * `Col` class separated into `Col` and `SOCol` (and same for all other
+ `*Col` classes). `Col` defines a column, `SOCol` is that definition
+ bound to a particular SQLObject class.
+
+ * Instance variable ``_SO_columns`` holds the `SOCol` instances.
+
SQLObject 0.3
=============
Index: SQLObject.html
===================================================================
RCS file: /cvsroot/sqlobject/SOWeb/docs/SQLObject.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SQLObject.html 8 Apr 2003 04:05:04 -0000 1.3
--- SQLObject.html 5 Jul 2003 04:39:07 -0000 1.4
***************
*** 5,66 ****
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.2.8: http://docutils.sourceforge.net/" />
! <title>SQLObject 0.3</title>
<link rel="stylesheet" href="default.css" type="text/css" />
</head>
<body>
! <div class="document" id="sqlobject-0-3">
! <h1 class="title">SQLObject 0.3</h1>
<div class="contents topic" id="contents">
<p class="topic-title"><a name="contents">Contents:</a></p>
[...1877 lines suppressed...]
! * <cite>CurrencyCol</cite></p>
! <p>From <cite>SQLObject.Join</cite>:
! * <cite>MultipleJoin</cite>
! * <cite>RelatedJoin</cite></p>
! <p>From <cite>SQLObject.Style</cite>:
! * <cite>Style</cite>
! * <cite>MixedCaseUnderscoreStyle</cite>
! * <cite>DefaultStyle</cite>
! * <cite>MixedCaseStyle</cite></p>
! <p>From <cite>SQLObject.SQLBuilder</cite>:</p>
<ul class="simple">
<li><cite>AND</cite></li>
***************
*** 882,885 ****
--- 1130,1134 ----
<li><cite>IN</cite></li>
<li><cite>LIKE</cite></li>
+ <li><cite>DESC</cite></li>
<li><cite>CONTAINSSTRING</cite></li>
<li><cite>const</cite></li>
Index: SQLObject.txt
===================================================================
RCS file: /cvsroot/sqlobject/SOWeb/docs/SQLObject.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SQLObject.txt 8 Apr 2003 04:05:04 -0000 1.3
--- SQLObject.txt 5 Jul 2003 04:39:07 -0000 1.4
***************
*** 1,4 ****
```````````````
! SQLObject 0.3
```````````````
--- 1,4 ----
```````````````
! SQLObject 0.4
```````````````
***************
[...1617 lines suppressed...]
! * `MultipleJoin`
! * `RelatedJoin`
!
! From `SQLObject.Style`:
! * `Style`
! * `MixedCaseUnderscoreStyle`
! * `DefaultStyle`
! * `MixedCaseStyle`
!
! From `SQLObject.SQLBuilder`:
* `AND`
***************
*** 907,910 ****
--- 1017,1021 ----
* `IN`
* `LIKE`
+ * `DESC`
* `CONTAINSSTRING`
* `const`
Index: build
===================================================================
RCS file: /cvsroot/sqlobject/SOWeb/docs/build,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** build 13 Mar 2003 20:45:39 -0000 1.3
--- build 5 Jul 2003 04:39:07 -0000 1.4
***************
*** 4,7 ****
--- 4,8 ----
cp $SOURCEDIR/*.txt $SOURCEDIR/*.css .
+ cp $SOURCEDIR/../examples/snippets/*.html ../examples/snippets/
cd ..
buildhtml.py
Index: default.css
===================================================================
RCS file: /cvsroot/sqlobject/SOWeb/docs/default.css,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** default.css 8 Apr 2003 04:05:04 -0000 1.3
--- default.css 5 Jul 2003 04:39:07 -0000 1.4
***************
*** 108,121 ****
font-family: Helvetica, Arial, sans-serif;
border: thin solid black;
- background-color: #cccccc;
-moz-border-radius: 8px;
padding: 4px;
}
h1.title {
text-align: center;
background-color: #444499;
color: #eeeeee;
! border: medium solid black;
-moz-border-radius: 20px;
}
--- 108,137 ----
font-family: Helvetica, Arial, sans-serif;
border: thin solid black;
-moz-border-radius: 8px;
padding: 4px;
}
+ h1 {
+ background-color: #444499;
+ border: medium solid black;
+ color: #ffffff;
+ }
+
+ h2 {
+ background-color: #666666;
+ color: #ffffff;
+ border: medium solid black;
+ }
+
+ h3, h4, h5, h6 {
+ background-color: #cccccc;
+ color: #000000;
+ }
+
h1.title {
text-align: center;
background-color: #444499;
color: #eeeeee;
! border: thick solid black;
-moz-border-radius: 20px;
}
***************
*** 236,237 ****
--- 252,274 ----
ul.auto-toc {
list-style-type: none }
+
+ // Highlighting:
+
+ .function {color: #000077; font-weight: bold}
+ .keyword {color: #004444;}
+ .comment {color: #770000; font-style: italic}
+ .normal {color: #000000;}
+ .string {color: #006600;}
+ .symbol {color: #000000;}
+
+ .htmltag {color: #000077;}
+ .htmlsymbol {color: #000000;}
+ .htmlnormal {color: #000000;}
+ .htmlcomment {color: #770000; font-style: italic}
+ .htmlstring {color: #006600;}
+ .htmlattr {color: #000000;}
+
+ .stmlfunction {color: #000077; font-weight: bold}
+ .stmlattr {color: #000000;}
+ .stmlstring {color: #006600;}
+ .stmlexpr {color: #004444;}
\ No newline at end of file
|