summaryrefslogtreecommitdiff
path: root/examples/beaker_caching/advanced.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-03-24 19:19:03 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-03-24 19:19:03 -0400
commitc6bceb77754bd72c462ce146f706758d1ad3da4a (patch)
tree0b9c935221c572bd75f3c88fe849fb17595e0a79 /examples/beaker_caching/advanced.py
parent1675811029553501bb23084604c64d974dfe739c (diff)
downloadsqlalchemy-c6bceb77754bd72c462ce146f706758d1ad3da4a.tar.gz
- converted all lazy=True|False|None to 'select'|'joined'|'noload'
- converted all eager to joined in examples - fixed beaker/advanced.py to reference RelationshipCache
Diffstat (limited to 'examples/beaker_caching/advanced.py')
-rw-r--r--examples/beaker_caching/advanced.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/beaker_caching/advanced.py b/examples/beaker_caching/advanced.py
index 8e3361b1e..e14b96973 100644
--- a/examples/beaker_caching/advanced.py
+++ b/examples/beaker_caching/advanced.py
@@ -8,8 +8,8 @@ and collection caching.
import environment
from model import Person, Address, cache_address_bits
-from meta import Session, FromCache, RelationCache
-from sqlalchemy.orm import eagerload
+from meta import Session, FromCache, RelationshipCache
+from sqlalchemy.orm import joinedload
def load_name_range(start, end, invalidate=False):
"""Load Person objects on a range of names.
@@ -22,7 +22,7 @@ def load_name_range(start, end, invalidate=False):
The `Person.addresses` collections are also cached. Its basically
another level of tuning here, as that particular cache option
- can be transparently replaced with eagerload(Person.addresses).
+ can be transparently replaced with joinedload(Person.addresses).
The effect is that each Person and his/her Address collection
is cached either together or separately, affecting the kind of
SQL that emits for unloaded Person objects as well as the distribution
@@ -35,13 +35,13 @@ def load_name_range(start, end, invalidate=False):
# have the "addresses" collection cached separately
# each lazyload of Person.addresses loads from cache.
- q = q.options(RelationCache("default", "by_person", Person.addresses))
+ q = q.options(RelationshipCache("default", "by_person", Person.addresses))
# alternatively, eagerly load the "addresses" collection, so that they'd
# be cached together. This issues a bigger SQL statement and caches
# a single, larger value in the cache per person rather than two
# separate ones.
- #q = q.options(eagerload(Person.addresses))
+ #q = q.options(joinedload(Person.addresses))
# if requested, invalidate the cache on current criterion.
if invalidate: