Closed raphodn closed 1 month ago
for f in Product.ARRAY_FIELDS:
print(f)
print(Product.objects.filter(**{f: None}).count())
Product.objects.filter(**{f: None}).update(**{f: list()})
https://github.com/openfoodfacts/open-prices/wiki/Useful-scripts#delete-duplicate-prices
What
During the OxF daily sync, we create (or update) each product. The input data is not always consistent, for instance some fields are sometimes missing. In that case, we currently set the field value to None.
We should rather skip that field, and let the model decide its default value.
Why