mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-29 12:06:28 -04:00
Accommodate tuples for ColumnDefault.__repr__
Fixed bug where ``__repr__`` of :class:`.ColumnDefault` would fail
if the argument were a tuple. Pull request courtesy Nicolas Caniart.
Change-Id: I08aa2448ef91054c43d6068ac54cedbdf7a83d64
Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/1
Fixes: #4126
(cherry picked from commit 5acc9b149a)
This commit is contained in:
committed by
Mike Bayer
parent
a92f6316ed
commit
d91edf2511
+7
@@ -0,0 +1,7 @@
|
||||
.. change::
|
||||
:tags: bug, sql
|
||||
:tickets: 4126
|
||||
:versions: 1.2.0b4
|
||||
|
||||
Fixed bug where ``__repr__`` of :class:`.ColumnDefault` would fail
|
||||
if the argument were a tuple. Pull request courtesy Nicolas Caniart.
|
||||
@@ -2081,7 +2081,7 @@ class ColumnDefault(DefaultGenerator):
|
||||
__visit_name__ = property(_visit_name)
|
||||
|
||||
def __repr__(self):
|
||||
return "ColumnDefault(%r)" % self.arg
|
||||
return "ColumnDefault(%r)" % (self.arg, )
|
||||
|
||||
|
||||
class Sequence(DefaultGenerator):
|
||||
|
||||
@@ -550,6 +550,7 @@ class MetaDataTest(fixtures.TestBase, ComparesTables):
|
||||
"CheckConstraint("
|
||||
"%s"
|
||||
", name='someconstraint')" % repr(ck.sqltext)),
|
||||
(ColumnDefault(('foo', 'bar')), "ColumnDefault(('foo', 'bar'))")
|
||||
):
|
||||
eq_(
|
||||
repr(const),
|
||||
|
||||
Reference in New Issue
Block a user