divio / aldryn-search

Haystack 2.0 search index for django CMS
Other
48 stars 78 forks source link

get_model_path doesn't appear to work as intended #19

Closed bufke closed 10 years ago

bufke commented 10 years ago

https://github.com/aldryn/aldryn-search/blob/master/aldryn_search/utils.py#L92

model_or_string = '{0},{1}'.format([app_label, model_name])

I think there are a few things wrong here. The extra [] around app_label, model_name gives a IndexError. Also there is a , separating the label and name but I think it should be . I would guess it's supposed to be:

model_or_string = '{0}.{1}'.format(app_label, model_name)

If one uses a string instead of a Model this issue is bypassed. For example this works.

class PlacesSearchView(AldrynSearchView):
    models = ['places.place']
czpython commented 10 years ago

yup, an oversight on my part. will push fix in a bit.

czpython commented 10 years ago

fixed by 1245220751b2e1d567d70d1bbe53b8fc8ba98078. thanks :)