timkolloch / tandoor_importer

A program to import food nutrients to a Tandoor instance
MIT License
1 stars 0 forks source link

Use FDC ID field of a food #4

Closed timkolloch closed 2 months ago

timkolloch commented 2 months ago

It is also possible to add a FDC ID directly to the food. This cannot be done via the UI but has to be done via the admin view. As this might be a bit annoying the way with setting the URL of a food to get the FDC ID should still be possible.

However foods imported from the Tandoor Open Data project already have an ID set so it would be a shame not to use those and having to add a URL despite the ID already being there.

The goal is to use the FDC ID field, if it is present and use the URL only as a fallback. When a FDC ID is set in the field and a URL is present the program should suppose that the user wanted to overwrite the given ID and the URL field should be used.

TL;DR