VForWaTer / metacatalog

Modular metadata management platform for environmental data.
https://vforwater.github.io/metacatalog
GNU General Public License v3.0
4 stars 1 forks source link

Accept database models as API inputs #274

Open mmaelicke opened 1 year ago

mmaelicke commented 1 year ago

Right now, lookup values (ie. the Unit used when creating a Variable) have to be passed as Union[int, str] to the api functions, ie: api.add_variable(unit: Union[int, str]).

We should rework the whole ADD API to accept the actual model and its dictionary representation as well. Thus, the argument should be of type: Union[int, str, models.Unit, dict].

This might apply to the FIND APIs as well.