[Sqlalchemy-tickets] Issue #3865: JSON column default with __init__ (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
From: jdkida <iss...@bi...> - 2016-12-01 00:03:26
|
New issue 3865: JSON column default with __init__ https://bitbucket.org/zzzeek/sqlalchemy/issues/3865/json-column-default-with-__init__ jdkida: ``` #!python class TestTable(Base): test_json = Column(JSON, default={"test": "test"}) test_string = Column(String, default='test') def __init__(self, test_json=None, test_string=None): test_json=test_json test_string=test_string # insert and query session.add(TestTable()) session.commit() tests = session.query(TestTable).all() for t in tests: print(t.test_json, t.test_string) ``` None, 'test' Responsible: zzzeek |