[Sqlalchemy-tickets] [sqlalchemy] #2592: allow loading of unhashable types with query
Brought to you by:
zzzeek
From: sqlalchemy <mi...@zz...> - 2012-10-16 00:01:15
|
#2592: allow loading of unhashable types with query -------------------------+--------------------------------------- Reporter: zzzeek | Owner: zzzeek Type: enhancement | Status: new Priority: medium | Milestone: 0.8.0 Component: orm | Severity: minor - half an hour Keywords: | Progress State: in progress -------------------------+--------------------------------------- {{{ #!python def test_unhashable_type(self): from sqlalchemy.types import TypeDecorator, Integer from sqlalchemy.sql import type_coerce class MyType(TypeDecorator): impl = Integer def process_result_value(self, value, dialect): return [value] User, users = self.classes.User, self.tables.users mapper(User, users) s = Session() row = s.\ query(User.id, type_coerce(users.c.id, MyType).label('foo')).\ filter(User.id == 7).first() eq_( row, (7, [7]) ) }}} -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2592> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |