identity_key() only accepts tuple as ident
Issue #2508
resolved
(original reporter: taha_jahangir) The documentation says that in call to identity_key(cls, ident), ident is primary key and MAY be tuple.
But when calling identity_key(Entity, 3)
, this exception will be raised:
File "/home/....py", line 166, in by_id_lock
id_key = identity_key(cls, id) # id is an integer
File "/usr/local/lib/python3.2/dist-packages/SQLAlchemy-0.7.7-py3.2.egg/sqlalchemy/orm/util.py", line 202, in identity_key
return mapper.identity_key_from_primary_key(ident)
File "/usr/local/lib/python3.2/dist-packages/SQLAlchemy-0.7.7-py3.2.egg/sqlalchemy/orm/mapper.py", line 1599, in identity_key_from_primary_key
return self._identity_class, tuple(primary_key)
TypeError: 'int' object is not iterable
Comments (2)
-
repo owner -
repo owner - removed milestone
Removing milestone: 0.7.8 (automated comment)
- Log in to comment
5b8e5d381c710b0d813022467acc56265e98a27d d7e8adc20de7927bee87d9ae8c582918bc4faa76
thanks for the report