Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Must not assume django_id is an int #138

Open
linkmic opened this issue Nov 26, 2014 · 1 comment
Open

Must not assume django_id is an int #138

linkmic opened this issue Nov 26, 2014 · 1 comment
Labels

Comments

@linkmic
Copy link

linkmic commented Nov 26, 2014

Hi,

In xapian_backend.py it is not safe to assume that django_id is an int. In my application, for example, I use django-uuidfield and the id (pk) of the objects cannot be cast to integer.

from xapian_backend.py

if field['field_name'] in ('id', 'django_id', 'django_ct'):
# Private fields are indexed in a different way:
# django_id is an int and django_ct is text;
# besides, they are indexed by their (unstemmed) value.
if field['field_name'] == 'django_id':
value = int(value)
value = _term_to_xapian_value(value, field['type'])

Do you have any suggestion how I could resolve this?
Thanks,
/mike

@jorgecarleitao
Copy link
Collaborator

You are correct. We are assuming ints. I don't see any issue in extending it to non-integers.

charles-vdulac added a commit to charles-vdulac/xapian-haystack that referenced this issue Nov 19, 2016
charles-vdulac added a commit to charles-vdulac/xapian-haystack that referenced this issue Nov 19, 2016
charles-vdulac added a commit to charles-vdulac/xapian-haystack that referenced this issue Nov 24, 2016
charles-vdulac added a commit to charles-vdulac/xapian-haystack that referenced this issue May 3, 2017
charles-vdulac added a commit to charles-vdulac/xapian-haystack that referenced this issue May 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants