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

handle 2 more special cases in ingredients #2272

Conversation

MarcusWolschon
Copy link
Contributor

Add handling for 2 more classes of special cases in ingredients

@MarcusWolschon
Copy link
Contributor Author

MarcusWolschon commented Jan 16, 2023

Is there a way to get all units and unit-aliases that contian spaces from the database?
These common cases work because of German grammar but if we could get identify the units before split() that would solve the general case.
I just don't know how.

@vabene1111
Copy link
Collaborator

It would be Unit.objects.filter(space=).all()

but that would mean that chaching needs to be added as every request to the ingredient parser would otherwise infer a database request against the whole set. I am not sure if this is already implemented to some degree but that is a rather large change so i would say we remove the hardcoded part from this PR, if you want you can play around with the database and if you come up with a solution that improves the results we can discuss it in its own PR, is that ok ?

@MarcusWolschon
Copy link
Contributor Author

done

@vabene1111 vabene1111 merged commit dfa0794 into TandoorRecipes:develop Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants