Skip to content

Instantly share code, notes, and snippets.

@dspruell
Created June 26, 2014 05:42
Show Gist options
  • Save dspruell/74009d35715198733b6d to your computer and use it in GitHub Desktop.
Save dspruell/74009d35715198733b6d to your computer and use it in GitHub Desktop.
$ python manage.py buildwatson
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/fubar/venv.d/django-tidb/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/Users/fubar/venv.d/django-tidb/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/fubar/venv.d/django-tidb/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/fubar/venv.d/django-tidb/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/Users/fubar/venv.d/django-tidb/lib/python2.7/site-packages/django/db/transaction.py", line 431, in inner
return func(*args, **kwargs)
File "/Users/fubar/venv.d/django-tidb/lib/python2.7/site-packages/watson/management/commands/buildwatson.py", line 117, in handle
refreshed_model_count += rebuild_index_for_model(model, engine_slug, verbosity)
File "/Users/fubar/venv.d/django-tidb/lib/python2.7/site-packages/watson/management/commands/buildwatson.py", line 50, in rebuild_index_for_model
_bulk_save_search_entries(iter_search_entries())
File "/Users/fubar/venv.d/django-tidb/lib/python2.7/site-packages/watson/registration.py", line 168, in _bulk_save_search_entries
search_entry_batch = list(islice(search_entries, 0, batch_size))
File "/Users/fubar/venv.d/django-tidb/lib/python2.7/site-packages/watson/management/commands/buildwatson.py", line 35, in iter_search_entries
for search_entry in search_engine_._update_obj_index_iter(obj):
File "/Users/fubar/venv.d/django-tidb/lib/python2.7/site-packages/watson/registration.py", line 418, in _update_obj_index_iter
"meta_encoded": json.dumps(adapter.get_meta(obj)),
File "/usr/local/Cellar/python/2.7.7_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 243, in dumps
return _default_encoder.encode(obj)
File "/usr/local/Cellar/python/2.7.7_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/Cellar/python/2.7.7_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/local/Cellar/python/2.7.7_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: Country(code=u'RU', flag_url='flags/{code}.gif') is not JSON serializable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment