dvdmgl / django-pg-fts

Implementation PostgeSQL for Full Text Search for Django >= 1.7
http://django-pg-fts.readthedocs.org/
Other
27 stars 13 forks source link

Django 1.8 AttributeError: 'Col' object has no attribute 'source' #4

Open pajooh opened 9 years ago

pajooh commented 9 years ago

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]

dvdmgl commented 9 years ago

@pajooh, sorry for the late response, and tnx for reporting this case. Can you show an example, so i can reproduce the error.

pajooh commented 9 years ago

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.

dvdmgl commented 9 years ago

I still can't reproduce the error. Added this case to test_query.py, Can you check request.GET.

pajooh commented 9 years ago

the request.GET is as it should be: it contains the search term fts_index :u'cultur'

pajooh commented 9 years ago

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?

dvdmgl commented 9 years ago

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.

pajooh commented 9 years ago

django 1.8 beta is out!

ramashishb commented 9 years ago

I am also trying this on Django 1.8, ran into the same error. Could you please fix this?

aehlke commented 9 years ago

Any update?

nuhbye commented 9 years ago

Any update? I am also stuck in this bug.