rhec/pyelasticsearch — pull request #28 by smaddineni (2012-10-11 16:48:44+00:00)
Title: fix for the error in json encoder

Traceback (most recent call last):
File "", line 1, in
File "/Users/smaddineni/projects/mergebranch/env/src/django-haystack/haystack/indexes.py", line 266, in update_object
self._get_backend(using).update(self, [instance])
File "/Users/smaddineni/projects/mergebranch/env/src/django-haystack/haystack/backends/elasticsearch_backend.py", line 175, in update
self.conn.bulk_index(self.index_name, 'modelresult', prepped_docs, id_field=ID)
File "/Users/smaddineni/projects/mergebranch/env/lib/python2.7/site-packages/pyelasticsearch/client.py", line 80, in decorate
return func(*args, query_params=query_params, **kwargs)
File "/Users/smaddineni/projects/mergebranch/env/lib/python2.7/site-packages/pyelasticsearch/client.py", line 323, in bulk_index
body_bits.append(self._encode_json(doc))
File "/Users/smaddineni/projects/mergebranch/env/lib/python2.7/site-packages/pyelasticsearch/client.py", line 225, in _encode_json
return json.dumps(body, cls=self.json_encoder)
File "/Users/smaddineni/projects/mergebranch/env/lib/python2.7/site-packages/simplejson/__init__.py", line 334, in dumps
**kw).encode(obj)
File "/Users/smaddineni/projects/mergebranch/env/lib/python2.7/site-packages/simplejson/encoder.py", line 237, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/Users/smaddineni/projects/mergebranch/env/lib/python2.7/site-packages/simplejson/encoder.py", line 311, in iterencode
return _iterencode(o, 0)
ValueError: Circular reference detected