Skip to content

identity_key() only accepts tuple as ident #2508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sqlalchemy-bot opened this issue Jun 11, 2012 · 2 comments
Closed

identity_key() only accepts tuple as ident #2508

sqlalchemy-bot opened this issue Jun 11, 2012 · 2 comments
Labels
bug Something isn't working orm
Milestone

Comments

@sqlalchemy-bot
Copy link
Collaborator

Migrated issue, originally created by Anonymous

(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
@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

5b8e5d3
d7e8adc

thanks for the report

@sqlalchemy-bot
Copy link
Collaborator Author

Changes by Michael Bayer (@zzzeek):

  • set milestone to "0.7.8"
  • changed status to closed

@sqlalchemy-bot sqlalchemy-bot added bug Something isn't working orm labels Nov 27, 2018
@sqlalchemy-bot sqlalchemy-bot added this to the 0.7.8 milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working orm
Projects
None yet
Development

No branches or pull requests

1 participant