query.get() raise a TypeError Exception

Issue #690 resolved
Former user created an issue

I obtain this tb when I call the get method of a query object

        Traceback (most recent call last):
          [some useless calls](remove)
          File "/home/david/Projects/sicpac/lib/almagest/storage/user.py", line 69, in get
            user = query.get(id)
          File "/home/david/Projects/sqlalchemy/lib/sqlalchemy/orm/query.py", line 82, in get
            return self._get(key, ident, **kwargs)
          File "/home/david/Projects/sqlalchemy/lib/sqlalchemy/orm/query.py", line 718, in _get
            q = q.params(**params)._select_context_options(populate_existing=reload, version_check=(lockmode is not None))
        exceptions.TypeError: params() keywords must be strings

printing **params shows:

{u'users_id': 'catalogatore'}

to solve this problem I call str to the params' keys (see the attached file)

Comments (3)

  1. Mike Bayer repo owner
    • changed milestone to 0.4.0

    ah, well the real error is params() only handles *params. we do need to support unicode keys for bind param names, actually. so i might want to put a single args into params() so a dictionary can be passed as well.

  2. Log in to comment