1. Marc Abramowitz
  2. sqlalchemy


Mike Bayer  committed 4b48e76


  • Participants
  • Parent commits 6e54c07
  • Branches default

Comments (0)

Files changed (3)

File doc/build/orm/collections.rst

View file
     posts = jack.posts[5:20]
 The dynamic relationship supports limited write operations, via the
-``append()`` and ``remove()`` methods. Since the read side of the dynamic
-relationship always queries the database, changes to the underlying collection
-will not be visible until the data has been flushed:
-.. sourcecode:: python+sql
+``append()`` and ``remove()`` methods::
     oldpost = jack.posts.filter(Post.headline=='old post').one()
     jack.posts.append(Post('new post'))
+Since the read side of the dynamic relationship always queries the 
+database, changes to the underlying collection will not be visible 
+until the data has been flushed.  However, as long as "autoflush" is 
+enabled on the :class:`.Session` in use, this will occur 
+automatically each time the collection is about to emit a 
 To place a dynamic relationship on a backref, use ``lazy='dynamic'``:
 .. sourcecode:: python+sql
 this collection is a ``list``::
     mapper(Parent, properties={
-        children = relationship(Child)
+        'children' : relationship(Child)
     parent = Parent()
     # use a set
     mapper(Parent, properties={
-        children = relationship(Child, collection_class=set)
+        'children' : relationship(Child, collection_class=set)
     parent = Parent()

File doc/build/orm/inheritance.rst

View file
 ``with_polymorphic`` setting.
 Advanced Control of Which Tables are Queried
 The :meth:`.Query.with_polymorphic` method and configuration works fine for
 simplistic scenarios. However, it currently does not work with any
 query the name of employees with particular criterion::
-        outerjoin((engineer, engineer.c.employee_id==Employee.c.employee_id)).\
-        outerjoin((manager, manager.c.employee_id==Employee.c.employee_id)).\
+        outerjoin((engineer, engineer.c.employee_id==Employee.employee_id)).\
+        outerjoin((manager, manager.c.employee_id==Employee.employee_id)).\
         filter(or_(Engineer.engineer_info=='w', Manager.manager_data=='q'))
 The base table, in this case the "employees" table, isn't always necessary. A
 Creating Joins to Specific Subtypes
 The :func:`~sqlalchemy.orm.interfaces.PropComparator.of_type` method is a
 helper which allows the construction of joins along

File lib/sqlalchemy/orm/collections.py

View file
     The recipe decorators all require parens, even those that take no
-        @collection.adds('entity'):
+        @collection.adds('entity')
         def insert(self, position, entity): ...