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

Use pg_trgm to save product with correct brand or brand with correct corporation #52

Open
5h3rr1ll opened this issue Mar 11, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@5h3rr1ll
Copy link
Owner

Describe the bug
Sometimes brand names are slightly different from the correct form or the name-string is combined with a comma and additional information. In that case, a new brand or a new corporation gets created which is not connected/related to any corporation or brand.

Expected behavior
We should use the same logic as we already use for the is_big_ten feedback, that we search for quite similar brands or corporations if we don't get a result right away.
I would say first try should be a clear get like Brand.objecs.get(name="coca cola") if that throws an error, we can try to find it like Brand.objects.filter(name__trigram_similar="coca cola") and if we still don't get a good result, we still can create a new brand.

@5h3rr1ll 5h3rr1ll added the enhancement New feature or request label Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant