Re: [Sqlalchemy-tickets] [sqlalchemy] #2850: cleanly upgrade the type of bindparam() with a null ty
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-10-21 20:24:43
|
#2850: cleanly upgrade the type of bindparam() with a null type
------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: new
Priority: high | Milestone: 0.9.0
Component: engine | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in progress |
------------------------------+-------------------------------
Description changed by zzzeek:
Old description:
> {{{
> #!python
>
> bp = bindparam("somevalue")
> stmt = test_table.update().values(avalue=bp)
> compiled = stmt.compile()
> eq_(bp.type._type_affinity, types.NullType)
> eq_(compiled.binds['somevalue'].type._type_affinity,
> MyCustomType)
>
> }}}
New description:
{{{
#!python
bp = bindparam("somevalue")
stmt = test_table.update().values(avalue=bp)
compiled = stmt.compile()
eq_(bp.type._type_affinity, types.NullType)
eq_(compiled.binds['somevalue'].type._type_affinity, MyCustomType)
# additionally:
bp = bindparam("foo")
expr = column("foo", MyFoobarType) + bp
assert bp.type._type_affinity is types.NullType
assert expr.right.type._type_affinity is MyFoobarType
}}}
--
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2850#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|