Update of /cvsroot/sqlobject/SOWeb/docs
In directory sc8-pr-cvs1:/tmp/cvs-serv13162/docs
Modified Files:
FAQ.html FAQ.txt default.css
Log Message:
Updated FAQ
Index: FAQ.html
===================================================================
RCS file: /cvsroot/sqlobject/SOWeb/docs/FAQ.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FAQ.html 7 Sep 2003 19:15:46 -0000 1.3
--- FAQ.html 9 Sep 2003 04:03:23 -0000 1.4
***************
*** 272,280 ****
<div class="section" id="non-integer-ids">
<h1><a name="non-integer-ids">Non-Integer IDs</a></h1>
! <p>SQLObject requires that you use an integer primary key, usually
! defined in a specific way (<tt class="literal"><span class="pre">INT</span> <span class="pre">PRIMARY</span> <span class="pre">KEY</span> <span class="pre">AUTO_INCREMENT</span></tt> for
! MySQL, for instance, or <tt class="literal"><span class="pre">SERIAL</span> <span class="pre">PRIMARY</span> <span class="pre">KEY</span></tt> for PostgreSQL). You
! cannot use strings or other kinds of values.</p>
! <p>This restriction will probably be removed soon.</p>
</div>
<div class="section" id="binary-values">
--- 272,299 ----
<div class="section" id="non-integer-ids">
<h1><a name="non-integer-ids">Non-Integer IDs</a></h1>
! <p>Yes, you can use non-integer IDs, but only in <a class="reference" href="http://sqlobject.org/#anonymous-cvs">CVS</a> now.</p>
! <p>If you use non-integer IDs, you will not be able to use automatic
! <tt class="literal"><span class="pre">CREATE</span> <span class="pre">TABLE</span></tt> generation (i.e., <tt class="literal"><span class="pre">createTable</span></tt>). You also will
! have to give your own ID values when creating an object, like:</p>
! <pre class="literal-block">
! color = Something.new(id="blue", r=0, b=100, g=0)
! </pre>
! <p>IDs are, and always will in future versions, be considered immutable.
! Right now that is not enforced; you can assign to the <tt class="literal"><span class="pre">id</span></tt>
! attribute. But if you do you'll just mess everything up. This will
! probably be taken away sometime to avoid possibly confusing bugs
! (actually, assigning to <tt class="literal"><span class="pre">id</span></tt> is almost certain to cause confusing
! bugs).</p>
! <p>If you are concerned about enforcing the type of IDs (which can be a
! problem even with integer IDs) you may want to do this:</p>
! <pre class="literal-block">
! def Color(SQLObject):
! def _init(self, id, connection=None):
! id = str(id)
! SQLObject._init(self, id, connection)
! </pre>
! <p>Instead of <tt class="literal"><span class="pre">str()</span></tt> you may use <tt class="literal"><span class="pre">int()</span></tt> or whatever else you want.
! This will be resolved in a future version when ID column types can be
! declared like other columns.</p>
</div>
<div class="section" id="binary-values">
Index: FAQ.txt
===================================================================
RCS file: /cvsroot/sqlobject/SOWeb/docs/FAQ.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FAQ.txt 7 Sep 2003 19:15:46 -0000 1.3
--- FAQ.txt 9 Sep 2003 04:03:23 -0000 1.4
***************
*** 147,156 ****
---------------
! SQLObject requires that you use an integer primary key, usually
! defined in a specific way (``INT PRIMARY KEY AUTO_INCREMENT`` for
! MySQL, for instance, or ``SERIAL PRIMARY KEY`` for PostgreSQL). You
! cannot use strings or other kinds of values.
! This restriction will probably be removed soon.
--- 147,178 ----
---------------
! Yes, you can use non-integer IDs, but only in CVS_ now.
! .. _CVS: http://sqlobject.org/#anonymous-cvs
!
! If you use non-integer IDs, you will not be able to use automatic
! ``CREATE TABLE`` generation (i.e., ``createTable``). You also will
! have to give your own ID values when creating an object, like::
!
! color = Something.new(id="blue", r=0, b=100, g=0)
!
! IDs are, and always will in future versions, be considered immutable.
! Right now that is not enforced; you can assign to the ``id``
! attribute. But if you do you'll just mess everything up. This will
! probably be taken away sometime to avoid possibly confusing bugs
! (actually, assigning to ``id`` is almost certain to cause confusing
! bugs).
!
! If you are concerned about enforcing the type of IDs (which can be a
! problem even with integer IDs) you may want to do this::
!
! def Color(SQLObject):
! def _init(self, id, connection=None):
! id = str(id)
! SQLObject._init(self, id, connection)
!
! Instead of ``str()`` you may use ``int()`` or whatever else you want.
! This will be resolved in a future version when ID column types can be
! declared like other columns.
Index: default.css
===================================================================
RCS file: /cvsroot/sqlobject/SOWeb/docs/default.css,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
|