django-pg-fts
django-pg-fts copied to clipboard
Django 1.8 AttributeError: 'Col' object has no attribute 'source'
this happens when i'm trying to use __search lookup in an fts index field. the error comes from fields.py in as_sql[282]
@pajooh, sorry for the late response, and tnx for reporting this case. Can you show an example, so i can reproduce the error.
Actually, i'm trying to use this package alongside django-filter to get a full text search box on a list. i added a TSVectorField
named ftx_index
with required migrations, and the added this into views:
class WorksSearch(django_filters.FilterSet):
filter_overrides = {
TSVectorField: {
'filter_class': django_filters.CharFilter,
'extra': lambda f: {
'lookup_type': 'search',
}
}
}
class Meta:
model = Work
fields = [ 'fts_index']
def works_list(request):
works = WorksSearch(request.GET, queryset=Work.objects.all())
return render_to_response('work_filter.html', {'filter': works})
the 'lookup_type': 'search'
config tell's django-filter to make a __search
lookup.
if this data is not sufficient, let me know.
I still can't reproduce the error. Added this case to test_query.py, Can you check request.GET.
the request.GET is as it should be: it contains the search term fts_index :u'cultur'
i was using Django 1.8a1, downgrading it to 1.7 resolved the issue. my app should work with django 1.8. could you please check if the issue could be fixed?
sorry again for the late response, apparently the freaking gmail filter isn't working. i'm waiting for the 1.8 beta release to work on this issue.
django 1.8 beta is out!
I am also trying this on Django 1.8, ran into the same error. Could you please fix this?
Any update?
Any update? I am also stuck in this bug.