]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
rename 'frozendict' to 'immutabledict', since 'frozen' implies hashability
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 20 Jan 2011 18:32:59 +0000 (13:32 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 20 Jan 2011 18:32:59 +0000 (13:32 -0500)
like frozenset which isn't really the purpose of 'immutabledict' (could be someday,
in which case, we'd change the name back :) )

CHANGES
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/ext/sqlsoup.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/schema.py
lib/sqlalchemy/sql/expression.py
lib/sqlalchemy/types.py
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/_collections.py
test/base/test_utils.py
test/lib/testing.py

diff --git a/CHANGES b/CHANGES
index b86d3b788e908e68d75614acafa8a87a9dab7d5a..c643b17f228ad700ae10713b51c32cb641789370 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,7 +5,66 @@ CHANGES
 =======
 0.7.0b1
 =======
+- Detailed descriptions of each change below are 
+  described at:
+  http://www.sqlalchemy.org/trac/wiki/07Migration
+
+- general
+  - New event system, supercedes all extensions, listeners,
+    etc.  [ticket:1902]
+
+  - Logging enhancements
+    [ticket:1926]
+
+  - Setup no longer installs a Nose plugin
+    [ticket:1949]
+
 - orm
+  - More succinct form of query.join(target, onclause)
+    [ticket:1923]
+
+  - Hybrid Attributes, implements/supercedes synonym()
+    [ticket:1903]
+
+  - Rewrite of composites [ticket:2008]
+
+  - Mutation Event Extension, supercedes "mutable=True"
+
+  - PickleType and ARRAY mutability turned off by default
+     [ticket:1980]
+
+  - Simplified polymorphic_on assignment
+    [ticket:1895]
+
+  - Flushing of Orphans that have no parent is allowed
+    [ticket:1912]
+
+  - Warnings generated when collection members, scalar referents 
+    not part of the flush
+    [ticket:1973]
+
+  - Non-`Table`-derived constructs can be mapped
+    [ticket:1876]
+
+  - Tuple label names in Query Improved
+    [ticket:1942]
+
+  - Mapped column attributes reference the most specific 
+    column first
+    [ticket:1892]
+
+  - Mapping to joins with two or more same-named columns 
+    requires explicit declaration
+    [ticket:1896]
+
+  - Mapper requires that polymorphic_on column be present 
+    in the mapped selectable
+    [ticket:1875]
+
+  - compile_mappers() renamed configure_mappers(), simplified 
+    configuration internals
+    [ticket:1966]
+
   - the aliased() function, if passed a SQL FromClause element
     (i.e. not a mapped class), will return element.alias() 
     instead of raising an error on AliasedClass.  [ticket:2018]
@@ -21,7 +80,41 @@ CHANGES
     in the open transaction of an engine explicitly.
     [ticket:1996]
 
+  - Query.join(), Query.outerjoin(), eagerload(), 
+    eagerload_all(), others no longer allow lists 
+    of attributes as arguments (i.e. option([x, y, z]) 
+    form, deprecated since 0.5)
+
+  - ScopedSession.mapper is removed 
+    (deprecated since 0.5)
+
 - sql
+  - LIMIT/OFFSET clauses now use bind parameters
+    [ticket:805]
+
+=== TypeDecorator works with primary key columns ===
+
+[ticket:2005] [ticket:2006]
+
+=== `DDL()` Constructs now Escape Percent Signs ===
+
+[ticket:1897]
+
+=== `Table.c` / `MetaData.tables` refined a bit, don't allow direct mutation ===
+
+[ticket:1893] [ticket:1917]
+
+=== Callables passed to `bindparam()` don't get evaluated ===
+
+[ticket:1950]
+
+=== types.type_map is now private, types._type_map ===
+
+[ticket:1870]
+
+=== Non-public Pool Methods Underscored ===
+[ticket:1982]
+
   - Added NULLS FIRST and NULLS LAST support. It's implemented
     as an extension to the asc() and desc() operators, called
     nullsfirst() and nullslast().  [ticket:723]
@@ -64,6 +157,10 @@ CHANGES
 
   - TypeDecorator is present in the "sqlalchemy" import space.
 
+-sqlite
+  - SQLite dialect now uses `NullPool` for file-based databases
+    [ticket:1921]
+
 - mssql
   - the String/Unicode types, and their counterparts VARCHAR/
     NVARCHAR, emit "max" as the length when no length is 
index 8de2e2a3a9c5a8c436d9f1dc5d4a9bc442451a04..ccce58b9c219b43f570592bf2513ddb4d9754e7d 100644 (file)
@@ -1734,7 +1734,7 @@ class Engine(Connectable, log.Identified):
 
     """
 
-    _execution_options = util.frozendict()
+    _execution_options = util.immutabledict()
     Connection = Connection
 
     def __init__(self, pool, dialect, url, 
index 9e6f63acac8673434aa505ab51933fcd1f94b31b..ded8a35cd50870f25b8028331735dbf33d810dbb 100644 (file)
@@ -620,7 +620,7 @@ class SqlSoup(object):
         self.session.expunge_all()
 
     def map_to(self, attrname, tablename=None, selectable=None, 
-                    schema=None, base=None, mapper_args=util.frozendict()):
+                    schema=None, base=None, mapper_args=util.immutabledict()):
         """Configure a mapping to the given attrname.
 
         This is the "master" method that can be used to create any 
index 59644591821966dfe6ec06430bff47d8a0fcecab..42dd60a2fcfbcba9e94f5199a0fd005dba9e0b59 100644 (file)
@@ -93,10 +93,10 @@ class Query(object):
     _select_from_entity = None
     _filter_aliases = None
     _from_obj_alias = None
-    _joinpath = _joinpoint = util.frozendict()
-    _execution_options = util.frozendict()
-    _params = util.frozendict()
-    _attributes = util.frozendict()
+    _joinpath = _joinpoint = util.immutabledict()
+    _execution_options = util.immutabledict()
+    _params = util.immutabledict()
+    _attributes = util.immutabledict()
     _with_options = ()
     _with_hints = ()
     _enable_single_crit = True
index 26f607512634dd99eef2ee235f7101f045fb9c4f..cf39d29ace1254bd2bcfd610731865744cb74541 100644 (file)
@@ -1940,7 +1940,7 @@ class MetaData(SchemaItem):
           ``MetaData``.
 
         """
-        self.tables = util.frozendict()
+        self.tables = util.immutabledict()
         self._schemas = set()
         self.bind = bind
         self.metadata = self
index 8a9d33d5536076ca5a197a7c21832eed327aedc7..64274359b15f6df56967f9cb06ae5b860f6bebdc 100644 (file)
@@ -2556,7 +2556,7 @@ class Executable(_Generative):
     """
 
     supports_execution = True
-    _execution_options = util.frozendict()
+    _execution_options = util.immutabledict()
 
     @_generative
     def execution_options(self, **kw):
@@ -4003,7 +4003,7 @@ class Select(_SelectBase):
     __visit_name__ = 'select'
 
     _prefixes = ()
-    _hints = util.frozendict()
+    _hints = util.immutabledict()
 
     def __init__(self, 
                 columns, 
@@ -4457,7 +4457,7 @@ class UpdateBase(Executable, ClauseElement):
 
     _execution_options = \
         Executable._execution_options.union({'autocommit': True})
-    kwargs = util.frozendict()
+    kwargs = util.immutabledict()
 
     def _process_colparams(self, parameters):
         if isinstance(parameters, (list, tuple)):
index a2ecafaa85b38b61bbcb27bfd9b6bb3bb95aec3b..1dcf379a956617b9313db632ff48056b1631d458 100644 (file)
@@ -703,7 +703,7 @@ class _DateAffinity(object):
     def _expression_adaptations(self):
         raise NotImplementedError()
 
-    _blank_dict = util.frozendict()
+    _blank_dict = util.immutabledict()
     def _adapt_expression(self, op, othertype):
         othertype = othertype._type_affinity
         return op, \
index 6950aa8e6d2606111769888983936f2e3ccf224d..f4861e5f4b9249898a0eb31ce48a224ac55d8700 100644 (file)
@@ -8,7 +8,7 @@ from compat import callable, cmp, reduce, defaultdict, py25_dict, \
     threading, py3k, jython, win32, set_types, buffer, pickle, \
     update_wrapper, partial, md5_hex, decode_slice, dottedgetter
 
-from _collections import NamedTuple, ImmutableContainer, frozendict, \
+from _collections import NamedTuple, ImmutableContainer, immutabledict, \
     Properties, OrderedProperties, ImmutableProperties, OrderedDict, \
     OrderedSet, IdentitySet, OrderedIdentitySet, column_set, \
     column_dict, ordered_column_set, populate_column_dict, unique_list, \
index 269a3d53901fb3c0eca4b5cd48a6ca603630266e..3adbf991330cd538bd42f43df396c9422d644838 100644 (file)
@@ -39,7 +39,7 @@ class ImmutableContainer(object):
 
     __delitem__ = __setitem__ = __setattr__ = _immutable
 
-class frozendict(ImmutableContainer, dict):
+class immutabledict(ImmutableContainer, dict):
 
     clear = pop = popitem = setdefault = \
         update = ImmutableContainer._immutable
@@ -53,18 +53,18 @@ class frozendict(ImmutableContainer, dict):
         pass
 
     def __reduce__(self):
-        return frozendict, (dict(self), )
+        return immutabledict, (dict(self), )
 
     def union(self, d):
         if not self:
-            return frozendict(d)
+            return immutabledict(d)
         else:
-            d2 = frozendict(self)
+            d2 = immutabledict(self)
             dict.update(d2, d)
             return d2
 
     def __repr__(self):
-        return "frozendict(%s)" % dict.__repr__(self)
+        return "immutabledict(%s)" % dict.__repr__(self)
 
 class Properties(object):
     """Provide a __getattr__/__setattr__ interface over a dict."""
index 845114447162b9519d381eac99504887dec4a982..e44a1862f0c4235a1f5a63f8fa91c0fbbd056008 100644 (file)
@@ -82,7 +82,7 @@ class OrderedSetTest(TestBase):
 
 class FrozenDictTest(TestBase):
     def test_serialize(self):
-        d = util.frozendict({1:2, 3:4})
+        d = util.immutabledict({1:2, 3:4})
         for loads, dumps in picklers():
             print loads(dumps(d))
 
index d6338cf10f2da64c174d16ea39666e74017a72a2..cdd5ee258ff867b36c9244f24eca49666176a443 100644 (file)
@@ -723,12 +723,12 @@ class AssertsExecutionResults(object):
         numbers of rows that the test suite manipulates.
         """
 
-        class frozendict(dict):
+        class immutabledict(dict):
             def __hash__(self):
                 return id(self)
 
         found = util.IdentitySet(result)
-        expected = set([frozendict(e) for e in expected])
+        expected = set([immutabledict(e) for e in expected])
 
         for wrong in itertools.ifilterfalse(lambda o: type(o) == cls, found):
             fail('Unexpected type "%s", expected "%s"' % (