pyeve / eve-sqlalchemy

SQLAlchemy data layer for Eve-powered RESTful APIs
http://eve-sqlalchemy.readthedocs.io
Other
234 stars 70 forks source link

Update parser.py #61

Closed terrysclaw closed 9 years ago

terrysclaw commented 9 years ago

Fix UnicodeEncodeError when filtering unicode string (#58)

goneri commented 9 years ago

I'm afraid this patch break Python3 support:

(...)
    r = f(resource, **combined_args)
  File "/home/goneri/git_repos/eve/eve/methods/get.py", line 105, in get
    build_response_document(document, resource, embedded_fields)
  File "/home/goneri/git_repos/eve/eve/methods/common.py", line 506, in build_response_document
    resolve_embedded_documents(document, resource, embedded_fields)
  File "/home/goneri/git_repos/eve/eve/methods/common.py", line 692, in resolve_embedded_documents
    subdocument[last_field]))
  File "/home/goneri/git_repos/eve/eve/methods/common.py", line 684, in <lambda>
    getter = lambda ref: embedded_document(ref, data_relation, field)  # noqa
  File "/home/goneri/git_repos/eve/eve/methods/common.py", line 623, in embedded_document
    **{config.ID_FIELD: reference})
  File "/home/goneri/git_repos/eve-sqlalchemy/eve_sqlalchemy/__init__.py", line 174, in find_one
    parse_dictionary(lookup, model))
  File "/home/goneri/git_repos/eve-sqlalchemy/eve_sqlalchemy/parser.py", line 45, in parse_dictionary
    if(type(v) is unicode):
NameError: name 'unicode' is not defined