etianen / django-watson

Full-text multi-table search application for Django. Easy to install and use, with good performance.
BSD 3-Clause "New" or "Revised" License
1.21k stars 129 forks source link

Problemas con django-watson 1.5.0 #239

Closed renearc closed 6 years ago

renearc commented 6 years ago

Estoy usando django-watson 1.5.0 para las búsquedas en django 2.0. Tengo registrados los modelos y cuando voy hacer gestiones sobre ellos, se muestra el error: 'OneToOneField' object has no attribute 'rel'. Alguien puede ayudarme, gracias de antemano.

etianen commented 6 years ago

Can you provide a full stack trace, please?

2018-02-22 22:13 GMT+00:00 renearc notifications@github.com:

Estoy usando django-watson 1.5.0 para las búsquedas en django 2.0. Tengo registrados los modelos y cuando voy hacer gestiones sobre ellos, se muestra el error: 'OneToOneField' object has no attribute 'rel'. Alguien puede ayudarme, gracias de antemano.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/etianen/django-watson/issues/239, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJFCM4kLX7FZu7TE3KwCwXNB7KB33jMks5tXeaIgaJpZM4SQEpH .

renearc commented 6 years ago

Hola, esto es lo que devuelve:

Traceback (most recent call last): File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/core/handlers/exception.py", line 35, in inner response = get_response(request) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/core/handlers/base.py", line 128, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/core/handlers/base.py", line 126, in _get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/contrib/admin/options.py", line 574, in wrapper return self.admin_site.admin_view(view)(*args, *kwargs) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/utils/decorators.py", line 142, in _wrapped_view response = view_func(request, args, kwargs) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func response = view_func(request, *args, kwargs) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/contrib/admin/sites.py", line 223, in inner return view(request, *args, *kwargs) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1553, in add_view return self.changeform_view(request, None, form_url, extra_context) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/utils/decorators.py", line 62, in _wrapper return bound_func(args, kwargs) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/utils/decorators.py", line 142, in _wrapped_view response = view_func(request, *args, *kwargs) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/utils/decorators.py", line 58, in bound_func return func.get(self, type(self))(args2, **kwargs2) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1450, in changeform_view return self._changeform_view(request, object_id, form_url, extra_context) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1490, in _changeform_view self.save_model(request, new_object, form, not add) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1026, in save_model obj.save() File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/db/models/base.py", line 729, in save force_update=force_update, update_fields=update_fields) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/db/models/base.py", line 769, in save_base update_fields=update_fields, raw=raw, using=using, File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 178, in send for receiver in self._live_receivers(sender) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 178, in for receiver in self._live_receivers(sender) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/watson/search.py", line 515, in _post_save_receiver self.update_obj_index(instance) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/watson/search.py", line 506, in update_obj_index _bulk_save_search_entries(list(self._update_obj_index_iter(obj))) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/watson/search.py", line 489, in _update_obj_index_iter object_id_int, search_entries = self._get_entries_for_obj(obj) File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/watson/search.py", line 457, in _get_entries_for_obj if has_int_pk(model): File "/home/albert/Envs/espacioDjango/lib/python3.5/site-packages/watson/models.py", line 26, in has_int_pk isinstance(pk, models.ForeignKey) and has_int_pk(pk.rel.to) AttributeError: 'OneToOneField' object has no attribute 'rel' [24/Feb/2018 02:38:35] "POST /admin/app/canal/add/ HTTP/1.1" 500 165668

renearc commented 6 years ago

PD: si cambio a django==1.11 no da problemas, pero esa no puede ser la solución, pues quiero trabajar con django 2.0, quedo al tanto

etianen commented 6 years ago

Please upgrade to django-watson==1.5.2. It includes a fix for the problem you describe.