[Sqlalchemy-tickets] Issue #4335: TypeError: unhashable type: 'list' with Oracle Sequence sqlalchem
Brought to you by:
zzzeek
From: Dileep J. <iss...@bi...> - 2018-09-17 14:52:12
|
New issue 4335: TypeError: unhashable type: 'list' with Oracle Sequence sqlalchemy https://bitbucket.org/zzzeek/sqlalchemy/issues/4335/typeerror-unhashable-type-list-with-oracle Dileep Jayamal: I'm trying to make **id** column **auto-increment** with **Sequence** in Oracle 12c as shown bellow: ``` class APIKey(db.Model): __tablename__ = 'APIKey' apikey_id_seq = db.Sequence('apikey_id_seq', metadata=db.Model.metadata) id = db.Column(db.Integer, apikey_id_seq, server_default= apikey_id_seq.next_value(),primary_key=True) name = db.Column(db.String(100)) username = db.Column(db.String(20), index=True, unique=True) key = db.Column(db.String(40)) ``` I created the the schema and add an object like bellow: ``` if __name__ == '__main__': db.drop_all() db.create_all() apikey = FingerAPIKey(name='dileep', username='dileep', key='1234') db.session.add(apikey) db.session.commit() app.run(host=host, port=port) ``` During the commit I get following error: ``` File "/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1688, in _register_newly_persistent if _none_set.intersection(instance_key[1]) and \ TypeError: unhashable type: 'list' ``` |