Domanda

Sto cercando di impostare Pagliaio con Fruscio, ma sto ottenendo questo errore valore "ValueError: Dizionario aggiornamento sequenza elemento # 0 è la lunghezza 9; è richiesto 2" quando si esegue il metodo di conteggio sull'oggetto SearchQuerySet in ./manage shell

>>> sqs.count()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.6/dist-packages/haystack/query.py", line 375, in count
    return len(clone)
  File "/usr/local/lib/python2.6/dist-packages/haystack/query.py", line 48, in __len__
    self._result_count = self.query.get_count()
  File "/usr/local/lib/python2.6/dist-packages/haystack/backends/__init__.py", line 399, in get_count
    self.run()
  File "/usr/local/lib/python2.6/dist-packages/haystack/backends/__init__.py", line 354, in run
    results = self.backend.search(final_query, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/haystack/backends/__init__.py", line 47, in wrapper
    return func(obj, query_string, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/haystack/backends/whoosh_backend.py", line 313, in search
    return self._process_results(raw_results, start_offset, end_offset, highlight=highlight, query_string=query_string, spelling_query=spelling_query)
  File "/usr/local/lib/python2.6/dist-packages/haystack/backends/whoosh_backend.py", line 350, in _process_results
    raw_result = dict(raw_result)
ValueError: dictionary update sequence element #0 has length 9; 2 is required
È stato utile?

Soluzione

Trovato la mia risposta qui https://github.com/toastdriven/ django-pagliaio / temi / chiuso # edizione / 281 si scopre che era un problema di versione.

Funziona se uso questi versioni specifiche di Haystack e Fruscio

pip install django-haystack==1.0.1-final

easy_install "Whoosh==1.0.0.b11"
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top