[Checkins] SVN: z3c.sqlalchemy/trunk/s reformatted docs
Andreas Jung
andreas at andreas-jung.com
Sun Jul 15 03:45:13 EDT 2007
Log message for revision 77988:
reformatted docs
Changed:
U z3c.sqlalchemy/trunk/setup.py
U z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/CHANGES.txt
U z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/README.txt
-=-
Modified: z3c.sqlalchemy/trunk/setup.py
===================================================================
--- z3c.sqlalchemy/trunk/setup.py 2007-07-15 00:48:27 UTC (rev 77987)
+++ z3c.sqlalchemy/trunk/setup.py 2007-07-15 07:45:12 UTC (rev 77988)
@@ -27,12 +27,12 @@
version = open(version_file).read().strip()
readme_file = os.path.join('src', 'z3c', 'sqlalchemy', 'README.txt')
-desc = open(readme_file).read()
+desc = open(readme_file).read().strip()
changes_file = os.path.join('src', 'z3c', 'sqlalchemy', 'CHANGES.txt')
-changes = open(changes_file).read()
+changes = open(changes_file).read().strip()
-long_description = desc + '\nChanges:\n========\n\n' + changes
+long_description = desc + '\n\nChanges\n=======\n\n' + changes
setup(name='z3c.sqlalchemy',
Modified: z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/CHANGES.txt
===================================================================
--- z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/CHANGES.txt 2007-07-15 00:48:27 UTC (rev 77987)
+++ z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/CHANGES.txt 2007-07-15 07:45:12 UTC (rev 77988)
@@ -1,4 +1,5 @@
1.0.9 (08.07.2007)
+------------------
- added namespace declarations
@@ -6,6 +7,7 @@
1.0.8 (28.06.2007)
+------------------
- SessionDataManager: create a session transaction as late
as possible and only if necessary in order to minimize deadlocks.
@@ -14,17 +16,20 @@
1.0.7 (27.06.2007)
+------------------
- SessionDataManager: moved commit code from tpc_vote()
to tpc_finish() (Thanks to Christian Theune for the hint)
1.0.6 (25.06.2007)
+------------------
- added 'namespace_packages' directive to setup.py
- cache 'metadata' property
1.0.5 (13.06.2007)
+------------------
- It should be now safe to use sessions from multiple wrappers
within one Zope transaction. In former versions of z3c.sqlalchemy
@@ -33,22 +38,26 @@
cases.
1.0.4 (09.06.2007)
+------------------
- added new 'transactional' flag (used by SQLAlchemyDA only)
1.0.3 (26.05.2007)
+------------------
- new 'cascade' parameter for the Model.add()
- tweaked the ZODB transaction integration a bit
1.0.2 (13.05.2007)
+------------------
- MappedClassBase has a new convinience method getMapper() that returns a
mapper class associated through a relation with the current mapper
1.0.1 (unreleased)
+------------------
- MappedClassBase: new clone() method
@@ -56,6 +65,7 @@
1.0.0 (05.05.2007)
+------------------
- source code polishing
@@ -63,6 +73,7 @@
0.1.13 (05.05.2007)
+-------------------
- sessions were returned from the wrong cache
@@ -72,12 +83,14 @@
0.1.12 (03.05.2007)
+-------------------
- createSAWrapper() got a new optional 'name' parameter in order
to register the wrapper automatically instead of using a dedicated
registerSAWrapper(wrapper, name) call
0.1.11 (02.05.2007)
+-------------------
- added check for the 'mapper_class' attribute (classes from now
on must be a subclass of MapperClassBase)
@@ -93,6 +106,7 @@
0.1.10 (30.04.2007)
+-------------------
- fixed a bug in mapper (unfortunately I forgot to commit a
necessary change)
@@ -107,6 +121,7 @@
0.1.9 (26.04.2007)
+------------------
- base.py: the 'model' parameter can now also be a callable
returning an instance of model.Model
@@ -122,6 +137,7 @@
0.1.8 (23.04.2007)
+------------------
- added shorter method names as aliases
@@ -130,8 +146,9 @@
0.1.7 (21.04.2007)
+------------------
- - replaced 'echo' parameter of the constructor with a generic **kw
+ - replaced 'echo' parameter of the constructor with a generic keyword
parameter in order to provide full parameter support for
create_engine. Optional arguments passed to the constructur are
passed directly to create_engine()
@@ -154,22 +171,26 @@
0.1.6 (28.03.2007)
+------------------
- fixed a bug in registerSQLAlchemyWrapper
0.1.5 (28.03.2007)
+------------------
- registerSQLAlchemyWrapper() should now work with Zope 2.8-2.10
- abort() was defined twice inside the DataManager class
0.1.4 (21.03.2007)
+------------------
- the Model class now behave (where needed) as a sorted
dictionary. Its items() method must returned all items
in insertion order.
0.1.3 (20.03.2007)
+------------------
- added getMappers() convenience method
@@ -179,14 +200,17 @@
0.1.2 (unreleased)
+------------------
- fixed class hierarchy issues with Postgres wrapper classes
0.1.1 (unreleased)
+------------------
- fixed setup.py
0.1 (18.03.2007)
+----------------
- initial version
Modified: z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/README.txt
===================================================================
--- z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/README.txt 2007-07-15 00:48:27 UTC (rev 77987)
+++ z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/README.txt 2007-07-15 07:45:12 UTC (rev 77988)
@@ -12,19 +12,17 @@
with Zope 2/3 and wrapper management (caching, introspection). z3c.sqlalchemy
gives you flexible control over the mapper creation. Mapper classes can be
- - auto-generated (with or without autodetection of table relationships)
+- auto-generated (with or without autodetection of table relationships)
+- configured by the developer
- - configured by the developer
-
What z3c.sqlalchemy does not do and won't do:
=============================================
- - no support for Zope 3 schemas
+- no support for Zope 3 schemas
+- no support for Archetypes schemas
- - no support for Archetypes schemas
-
z3c.sqlachemy just tries to provide you with the basic functionalities you need
to write SQLAlchemy-based applications with Zope 2/3. Higher-level
functionalities like integration with Archetypes/Zope 3 schemas are subject to
@@ -34,56 +32,50 @@
Requirements:
=============
- - Zope 2.8+, Zope 3.X
+- Zope 2.8+, Zope 3.X
+- SQLAlchemy 0.3.8 or higher
+- Python 2.4+
- - SQLAlchemy 0.3.8 or higher
- - Python 2.4+
-
-
Installation:
=============
- - using easy_install::
+Either using easy_install::
- > easy_install z3c.sqlalchemy
+ easy_install z3c.sqlalchemy
- Use the --no-deps option if you don't want the zope.* eggs installed
+or using Python directly::
+ python2.4 setup.py install
- - using Python directly::
+Note:
+-----
+z3c.sqlalchemy depends on the modules **zope.component**, **zope.schema**
+and **zope.interface**. If you are using z3c.sqlalchemy in a Python-only
+environment, ensure the these components have to be installed either
+as eggs or by setting the PYTHONPATH to a corresponding Zope 2
+or Zope 3 installation.
- > python2.4 setup.py install
- (or using python2.5)
-
-
- - z3c.sqlalchemy depends on the modules zope.component, zope.schema
- and zope.interface. If you are using z3c.sqlalchemy in a Python-only
- environment, ensure the these components have to be installed either
- as eggs or by setting the PYTHONPATH to a corresponding Zope 2
- or Zope 3 installation.
-
-
Usage
=====
Basic usage from within a pure Python application::
- > from z3c.sqlalchemy import createSAWrapper
- > wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB')
- > session = wrapper.session
- > FormatMapper = wrapper.getMapper('format') # auto-generated mapper for table 'format'
- > for row in session.query(FormatMapper).select(...): print row
- > session.flush() # if necessary
+ from z3c.sqlalchemy import createSAWrapper
+ wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB')
+ session = wrapper.session
+ FormatMapper = wrapper.getMapper('format') # auto-generated mapper for table 'format'
+ for row in session.query(FormatMapper).select(...): print row
+ session.flush() # if necessary
When using Zope 2/3 you can use the same code but you want a wrapper that
participates in Zope transactions. For this purpose you must use the additional
parameter 'forZope'::
- > from z3c.sqlalchemy import createSAWrapper
- > wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB', forZope=True)
- > session = wrapper.session
+ from z3c.sqlalchemy import createSAWrapper
+ wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB', forZope=True)
+ session = wrapper.session
In this case the session will participate automatically in a Zope transaction.
The wrapper will call automatically session.flush() upon a transaction commit.
@@ -108,11 +100,11 @@
Example::
- > from z3c.sqlalchemy import createSAWrapper, Model
- > model = Model()
- > model.add(name='A', relations=('B',))
- > wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB', model=model)
- > AMapper= wrapper.getMapper('A')
+ from z3c.sqlalchemy import createSAWrapper, Model
+ model = Model()
+ model.add(name='A', relations=('B',))
+ wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB', model=model)
+ AMapper= wrapper.getMapper('A')
This will generate a mapper AMapper where all instances of AMapper have a
property 'B' that relates to all corresponding rows in B (see the SQLAlchemy
@@ -125,11 +117,11 @@
way. Therefore this feature of z3c.sqlalchemy is highly experimental and currently
only available for Postgres (tested with Postgres 8.X).::
- > from z3c.sqlalchemy import createSAWrapper, Model
- > model = Model()
- > model.add(name='A', autodetect_relations=True)
- > wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB', model=model)
- > AMapper= wrapper.getMapper('A')
+ from z3c.sqlalchemy import createSAWrapper, Model
+ model = Model()
+ model.add(name='A', autodetect_relations=True)
+ wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB', model=model)
+ AMapper= wrapper.getMapper('A')
In this case z3c.sqlalchemy will scan all tables in order to detect
relationships automatically and build the mapper class and its properties
@@ -141,13 +133,13 @@
generated mapper. Also this usecase is supported by passing the base class to
the model using the 'mapper_class' parameter::
- > from z3c.sqlalchemy import createSAWrapper, Model
- > from z3c.sqlalchemy.mapper import MappedClassBase
- > class MyAMapper(MappedClassBase): pass
- > model = Model()
- > model.add(name='A', relations=('B',) mapper_class = MyAMapper)
- > wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB', model=model)
- > AMapper= wrapper.getMapper('A') # AMapper will be an instance of MyAMapper
+ from z3c.sqlalchemy import createSAWrapper, Model
+ from z3c.sqlalchemy.mapper import MappedClassBase
+ class MyAMapper(MappedClassBase): pass
+ model = Model()
+ model.add(name='A', relations=('B',) mapper_class = MyAMapper)
+ wrapper = createSAWrapper('postgres://postgres:postgres@host/someDB', model=model)
+ AMapper= wrapper.getMapper('A') # AMapper will be an instance of MyAMapper
When you are working with wrapper in a Zope 2/3 environment you are usually
interested to to register a wrapper instance as named utility implementing
@@ -158,27 +150,11 @@
A convenience method for obtaining a wrapper instance by name is available
through getSAWrapper::
- > createSAWrapper(dsn,..., name='my.name')
- > ...
- > wrapper = getSAWrapper('my.name')
+ createSAWrapper(dsn,..., name='my.name')
+ ...
+ wrapper = getSAWrapper('my.name')
-Installation:
-=============
-
- - either install z3c.sqlalchemy using easy_install from Cheeseshop:
-
- **easy_install z3c.sqlalchemy**
-
- - or download the sources from Cheeseshop at
-
- http://cheeseshop.python.org/pypi/z3c.sqlalchemy/1.0.0
-
- and install it manually after unpacking the sources:
-
- **python2.4 setup.py install**
-
-
Supported systems
=================
@@ -227,4 +203,3 @@
Bernstein & others) and Alchemist/ore.alchemist (Kapil Thangavelu). Thanks to
Martin Aspeli for giving valuable feedback.
-
More information about the Checkins
mailing list