-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: new Product.categories_tags array field #192
Conversation
b81ad2f
to
51a84ea
Compare
@@ -38,6 +38,7 @@ def init_sentry(sentry_dsn: str | None, integrations: list[Integration] | None = | |||
"product_name", | |||
"product_quantity", | |||
"product_quantity_unit", | |||
"categories_tags", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raphael0202 need your input : I added the field in the OFF sync, but i was wondering if we should get the raw data or filter it a bit (for instance only keep the en:
categories ?
example : https://world.openfoodfacts.org/api/v2/product/8001505005592.json
"categories_tags":["en:breakfasts","en:spreads","en:sweet-spreads","fr:pates-a-tartiner","en:hazelnut-spreads","en:chocolate-spreads","en:cocoa-and-hazelnuts-spreads"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I missed this comment. I think we can add all categories, some categories don't start with en:
and are however valid categories with respect to the category taxonomy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but what is the default behavior ? If there is an english translation, is the category stored as en: by default ? Or can there be both en & non en categories ?
51a84ea
to
d470e66
Compare
d470e66
to
4bcf817
Compare
What
New
Product.categories_tags
field.Why ?
Will be useful for searching/filtering/comparing in the frontend
Extra info
server_default="{}"
? see https://stackoverflow.com/questions/30933266/empty-array-as-postgresql-array-column-default-value