summaryrefslogtreecommitdiff
path: root/test/orm/test_mapper.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-08-20 17:04:25 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-08-20 17:04:25 -0400
commitaef0c7a903464f4e05496c69ff4e78d41239c220 (patch)
tree716afd20faf81a90ca734b946be619549f8d4384 /test/orm/test_mapper.py
parentce1b80ad08f58ea18914a93805754a5e19a85abb (diff)
downloadsqlalchemy-aef0c7a903464f4e05496c69ff4e78d41239c220.tar.gz
- [feature] The Core oeprator system now includes
the `getitem` operator, i.e. the bracket operator in Python. This is used at first to provide index and slice behavior to the Postgresql ARRAY type, and also provides a hook for end-user definition of custom __getitem__ schemes which can be applied at the type level as well as within ORM-level custom operator schemes. Note that this change has the effect that descriptor-based __getitem__ schemes used by the ORM in conjunction with synonym() or other "descriptor-wrapped" schemes will need to start using a custom comparator in order to maintain this behavior. - [feature] postgresql.ARRAY now supports indexing and slicing. The Python [] operator is available on all SQL expressions that are of type ARRAY; integer or simple slices can be passed. The slices can also be used on the assignment side in the SET clause of an UPDATE statement by passing them into Update.values(); see the docs for examples. - [feature] Added new "array literal" construct postgresql.array(). Basically a "tuple" that renders as ARRAY[1,2,3].
Diffstat (limited to 'test/orm/test_mapper.py')
-rw-r--r--test/orm/test_mapper.py7
1 files changed, 0 insertions, 7 deletions
diff --git a/test/orm/test_mapper.py b/test/orm/test_mapper.py
index a87c064cf..ab66ad65f 100644
--- a/test/orm/test_mapper.py
+++ b/test/orm/test_mapper.py
@@ -1108,8 +1108,6 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
assert_col = []
class extendedproperty(property):
attribute = 123
- def __getitem__(self, key):
- return 'value'
class User(object):
def _get_name(self):
@@ -1169,7 +1167,6 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
assert u in sess.dirty
eq_(User.uname.attribute, 123)
- eq_(User.uname['key'], 'value')
def test_synonym_of_synonym(self):
users, User = (self.tables.users,
@@ -1266,9 +1263,6 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
def method1(self):
return "method1"
- def __getitem__(self, key):
- return 'value'
-
from sqlalchemy.orm.properties import ColumnProperty
class UCComparator(ColumnProperty.Comparator):
__hash__ = None
@@ -1341,7 +1335,6 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
assert u2 is u3
eq_(User.uc_name.attribute, 123)
- eq_(User.uc_name['key'], 'value')
sess.rollback()
def test_comparable_column(self):