[Zodb-checkins] CVS: StandaloneZODB/Doc/guide - introduction.tex:1.1.2.2 prog-zodb.tex:1.1.2.2 transactions.tex:1.1.2.2 zeo.tex:1.1.2.2 zodb.tex:1.1.2.2
Barry Warsaw
barry@wooz.org
Fri, 8 Feb 2002 16:26:45 -0500
Update of /cvs-repository/StandaloneZODB/Doc/guide
In directory cvs.zope.org:/tmp/cvs-serv21560
Modified Files:
Tag: StandaloneZODB-1_0-branch
introduction.tex prog-zodb.tex transactions.tex zeo.tex
zodb.tex
Log Message:
Integrating version 0.03 of Andrew's programming guide.
=== StandaloneZODB/Doc/guide/introduction.tex 1.1.2.1 => 1.1.2.2 ===
This guide explains how to write Python programs that use the Z Object
-Database (ZODB) and Zope Enterprise Objects (ZEO).
+Database (ZODB) and Zope Enterprise Objects (ZEO). The latest version
+of the guide is always available at
+\url{http://www.amk.ca/zodb/guide/}.
\subsection{What is the ZODB?}
@@ -111,7 +113,7 @@
at a Python object-relational mapper, and
\url{http://www.python.org/workshops/1997-10/proceedings/shprentz.html}
for Joel Shprentz's more successful implementation of the same idea;
-Unlike mine, Shprentz's system has been used for actuual work.)
+Unlike mine, Shprentz's system has been used for actual work.)
However, it is difficult to make an object-relational mapper
reasonably quick; a simple-minded implementation like mine is quite
@@ -150,7 +152,7 @@
\subsection{What is ZEO?}
The ZODB comes with a few different classes that implement the
-\class{Storage} interface. Such \class{*Storage} classes handle the job of
+\class{Storage} interface. Such classes handle the job of
writing out Python objects to a physical storage medium, which can be
a disk file (the \class{FileStorage} class), a BerkeleyDB file
(\class{BerkeleyStorage}), a relational database
@@ -176,10 +178,11 @@
This document will always be a work in progress. If you wish to
suggest clarifications or additional topics, please send your comments to
-\email{akuchlin@mems-exchange.org}.
+\email{akuchlin@mems-exchange.org}.
\subsection{Acknowledgements}
I'd like to thank the people who've pointed out inaccuracies and bugs,
offered suggestions on the text, or proposed new topics that should be
-covered: Jeff Bauer, Willem Broekema, Chris McDonough, George Runyan.
+covered: Jeff Bauer, Willem Broekema, Thomas Guettler,
+Chris McDonough, George Runyan.
=== StandaloneZODB/Doc/guide/prog-zodb.tex 1.1.2.1 => 1.1.2.2 ===
storage = FileStorage.FileStorage('/tmp/test-filestorage.fs')
-db = DB( storage )
+db = DB(storage)
conn = db.open()
\end{verbatim}
@@ -246,7 +246,7 @@
...
# Add object to the BTree, keyed on the ID
-userdb[ newuser.id ] = newuser
+userdb[newuser.id] = newuser
# Commit the change
get_transaction().commit()
@@ -267,7 +267,7 @@
can experiment with transactions at the Python interpreter's prompt:
\begin{verbatim}>>> newuser
-<User instance at 81b1f40>
+<User instance at 81b1f40>
>>> newuser.first_name # Print initial value
'Andrew'
>>> newuser.first_name = 'Bob' # Change first name
@@ -330,7 +330,7 @@
The most common idiom that \emph{isn't} caught by the ZODB is
mutating a list or dictionary. If \class{User} objects have a
attribute named \code{friends} containing a list, calling
-\code{userobj.friends.append( otherUser )} doesn't mark
+\code{userobj.friends.append(otherUser)} doesn't mark
\code{userobj} as modified; from the ZODB's point of
view, \code{userobj.friends} was only read, and its value, which
happened to be an ordinary Python list, was returned. The ZODB isn't
@@ -343,7 +343,7 @@
\member{_p_changed} attribute of the object to true:
\begin{verbatim}
-userobj.friends.append( otherUser )
+userobj.friends.append(otherUser)
userobj._p_changed = 1
\end{verbatim}
@@ -362,7 +362,7 @@
\begin{verbatim}
def add_friend(self, friend):
- self.friends.append( otherUser )
+ self.friends.append(otherUser)
self._p_changed = 1
\end{verbatim}
=== StandaloneZODB/Doc/guide/transactions.tex 1.1.2.1 => 1.1.2.2 ===
except VersionLockError, (obj_id, version):
print ('Cannot commit; object %s '
- 'locked by version %s' % (obj_id, version) )
+ 'locked by version %s' % (obj_id, version))
\end{verbatim}
The exception provides the ID of the locked object, and the name of
=== StandaloneZODB/Doc/guide/zeo.tex 1.1.2.1 => 1.1.2.2 ===
addr = ('kronos.example.com', 1975)
storage = ClientStorage.ClientStorage(addr)
-db = DB( storage )
+db = DB(storage)
conn = db.open()
root = conn.root()
@@ -198,7 +198,7 @@
while 1:
try:
now = time.time()
- self._messages[ now ] = message
+ self._messages[now] = message
get_transaction().commit()
except ConflictError:
# Conflict occurred; this process should pause and
@@ -236,7 +236,7 @@
for T2, message in self._messages.items():
if T2 > T:
- new.append( message )
+ new.append(message)
self._v_last_time = T2
return new
=== StandaloneZODB/Doc/guide/zodb.tex 1.1.2.1 => 1.1.2.2 ===
\title{ZODB/ZEO Programming Guide}
-\release{0.02}
+\release{0.03}
\date{\today}
\author{A.M.\ Kuchling}
@@ -11,7 +11,7 @@
\maketitle
\tableofcontents
-\copyright{Copyright 2001 A.M. Kuchling.
+\copyright{Copyright 2002 A.M. Kuchling.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;