rafaelcds

Can't serialize select result with fields from two tables

Apr 20th, 2011
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.02 KB | None | 0 0
  1. Traceback (most recent call last):
  2.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/gluon/restricted.py", line 188, in restricted
  3.     exec ccode in environment
  4.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/applications/Hotelaria/controllers/despesa.py", line 81, in <module>
  5.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/gluon/globals.py", line 95, in <lambda>
  6.     self._caller = lambda f: f()
  7.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/applications/Hotelaria/controllers/despesa.py", line 50, in getDespesasPorHospedagem
  8.     return response.json({'despesas': despesas})
  9.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/gluon/globals.py", line 206, in json
  10.     return json(data)
  11.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/gluon/serializers.py", line 31, in json
  12.     return simplejson.dumps(value)
  13.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/gluon/contrib/simplejson/__init__.py", line 228, in dumps
  14.     return _default_encoder.encode(obj)
  15.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/gluon/contrib/simplejson/encoder.py", line 232, in encode
  16.     chunks = list(chunks)
  17.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/gluon/contrib/simplejson/encoder.py", line 501, in _iterencode
  18.     for chunk in _iterencode_dict(o, _current_indent_level):
  19.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/gluon/contrib/simplejson/encoder.py", line 475, in _iterencode_dict
  20.     for chunk in chunks:
  21.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/gluon/contrib/simplejson/encoder.py", line 511, in _iterencode
  22.     o = _default(o)
  23.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/gluon/contrib/simplejson/encoder.py", line 205, in default
  24.     return o.as_dict()
  25.   File "/media/dadosext/Rafael/Projetos-Programacao/Python/web2py/gluon/dal.py", line 4832, in as_dict
  26.     return dict([(r[key],r) for r in rows])
  27. KeyError: 'id'
Advertisement
Add Comment
Please, Sign In to add comment