[Checkins] SVN: persistent/trunk/ Move in-package docs out to the docs directory.

Tres Seaver tseaver at palladion.com
Wed Feb 16 21:49:56 EST 2011


Log message for revision 120408:
  Move in-package docs out to the docs directory.

Changed:
  U   persistent/trunk/docs/index.rst
  A   persistent/trunk/docs/using.rst
  D   persistent/trunk/persistent/README.txt

-=-
Modified: persistent/trunk/docs/index.rst
===================================================================
--- persistent/trunk/docs/index.rst	2011-02-17 02:34:39 UTC (rev 120407)
+++ persistent/trunk/docs/index.rst	2011-02-17 02:49:56 UTC (rev 120408)
@@ -10,6 +10,7 @@
 .. toctree::
    :maxdepth: 2
 
+   using
    api
 
 Indices and tables

Added: persistent/trunk/docs/using.rst
===================================================================
--- persistent/trunk/docs/using.rst	                        (rev 0)
+++ persistent/trunk/docs/using.rst	2011-02-17 02:49:56 UTC (rev 120408)
@@ -0,0 +1,57 @@
+Using :mod:`persistent` in your application
+===========================================
+
+.. note::
+    This document is under construction. More basic documentation will
+    eventually appear here.
+
+
+Inheriting from :class:`persistent.Persistent`
+----------------------------------------------
+
+The basic mechanism for making your application's objects persistent
+is mix-in interitance.  Instances whose classes derive from
+:class:`persistent.Persistent` are automatically capable of being
+created as :term:`ghost` instances, being associated with a database
+connection (called :term:`jar`), and notifying the connection when they
+have been changed.
+
+
+Overriding the attribute protocol
+---------------------------------
+
+Subclasses can override the attribute-management methods provided by
+:class:`persistent.Persistent`.  For the `__getattr__` method, the behavior
+is like that for regular Python classes and for earlier versions of ZODB 3.
+
+When overriding `__getattribute__`, the derived class implementation
+**must** first call :meth:`persistent.Persistent._p_getattr`, passing the
+name being accessed.  This method ensures that the object is activated,
+if needed, and handles the "special" attributes which do not require
+activation (e.g., ``_p_oid``, ``__class__``, ``__dict__``, etc.) 
+If ``_p_getattr`` returns ``True``, the derived class implementation
+**must** delegate to the base class implementation for the attribute.
+
+When overriding `__setattr__`, the derived class implementation
+**must** first call :meth:`persistent.Persistent._p_setattr`, passing the
+name being accessed and the value.  This method ensures that the object is
+activated, if needed, and handles the "special" attributes which do not
+require activation (``_p_*``).  If ``_p_setattr`` returns ``True``, the
+derived implementation must assume that the attribute value has been set by
+the base class.
+
+When overriding `__detattr__`, the derived class implementation
+**must** first call :meth:`persistent.Persistent._p_detattr`, passing the
+name being accessed.  This method ensures that the object is
+activated, if needed, and handles the "special" attributes which do not
+require activation (``_p_*``).  If ``_p_delattr`` returns ``True``, the
+derived implementation must assume that the attribute has been deleted
+base class.
+
+
+
+More Examples
+-------------
+
+Detailed examples are provided in the test module,
+`persistent.tests.test_overriding_attrs`.

Deleted: persistent/trunk/persistent/README.txt
===================================================================
--- persistent/trunk/persistent/README.txt	2011-02-17 02:34:39 UTC (rev 120407)
+++ persistent/trunk/persistent/README.txt	2011-02-17 02:49:56 UTC (rev 120408)
@@ -1,19 +0,0 @@
-===================
-Persistence support
-===================
-
-(This document is under construction. More basic documentation will eventually
-appear here.)
-
-
-Overriding `__getattr__`, `__getattribute__`, `__setattr__`, and `__delattr__`
-------------------------------------------------------------------------------
-
-Subclasses can override the attribute-management methods.  For the
-`__getattr__` method, the behavior is like that for regular Python
-classes and for earlier versions of ZODB 3.
-
-For `__getattribute__`, __setattr__`, and `__delattr__`, it is necessary
-to call certain methods defined by `persistent.Persistent`.  Detailed
-examples and documentation is provided in the test module,
-`persistent.tests.test_overriding_attrs`.



More information about the checkins mailing list