]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Unicode, UnicodeText types now set "assert_unicode" and
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 9 Jul 2008 16:33:38 +0000 (16:33 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 9 Jul 2008 16:33:38 +0000 (16:33 +0000)
      "convert_unicode" by default, but accept overriding
      **kwargs for these values.

CHANGES
lib/sqlalchemy/types.py

diff --git a/CHANGES b/CHANGES
index 68ac6ff893fa8203f0efe564a8c508d5e2c5d405..8d83e7916849a640be4d987b163650e9ebffccf5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -49,6 +49,10 @@ CHANGES
       strings to insert after CREATE in the CREATE TABLE statement.
       [ticket:1075]
 
+    - Unicode, UnicodeText types now set "assert_unicode" and
+      "convert_unicode" by default, but accept overriding
+      **kwargs for these values.
+      
 - sqlite
     - Modified SQLite's representation of "microseconds" to 
       match the output of str(somedatetime), i.e. in that the
index bae079e649bd45ef9077e24cb3bb66f6e48e4191..6b63377545e3303f08721b1e770f79295fb4c66c 100644 (file)
@@ -423,16 +423,16 @@ class Unicode(String):
     """A synonym for String(length, convert_unicode=True, assert_unicode='warn')."""
 
     def __init__(self, length=None, **kwargs):
-        kwargs['convert_unicode'] = True
-        kwargs['assert_unicode'] = 'warn'
+        kwargs.setdefault('convert_unicode', True)
+        kwargs.setdefault('assert_unicode', 'warn')
         super(Unicode, self).__init__(length=length, **kwargs)
 
 class UnicodeText(Text):
     """A synonym for Text(convert_unicode=True, assert_unicode='warn')."""
 
     def __init__(self, length=None, **kwargs):
-        kwargs['convert_unicode'] = True
-        kwargs['assert_unicode'] = 'warn'
+        kwargs.setdefault('convert_unicode', True)
+        kwargs.setdefault('assert_unicode', 'warn')
         super(UnicodeText, self).__init__(length=length, **kwargs)
 
 class Integer(TypeEngine):