OpenEnergyPlatform / oeplatform

Repository for the code of the Open Energy Platform (OEP) website. The OEP provides an interface to the Open Energy Family
http://openenergyplatform.org/
GNU Affero General Public License v3.0
61 stars 19 forks source link

Move endpoint variable to settings #1643

Open h-spinde opened 1 month ago

h-spinde commented 1 month ago

Summary of the discussion

As part of solving issue 1394, the variables query_endpoint and update_endpoint should be moved from views.py to settings.py

Workflow checklist

PR-Assignee

Reviewer

jh-RLI commented 1 month ago

That's great :) I would also like to draw your attention to some efforts I have made to make the code more modular:

I created a subfolder factsheet/oekg where this file is located https://github.com/OpenEnergyPlatform/oeplatform/blob/develop/factsheet/oekg/connection.py

I think we should use this for managing the connections. There you will see the same endpoints, these should also be imported from the settings. Then in the factsheet/views.py I suggest to import the factsheet/oekg/connection.py and use this for the oekg connection. In addition, we can then also remove this section as I have moved it to https://github.com/OpenEnergyPlatform/oeplatform/blob/develop/factsheet/oekg/namespaces.py.

What do you think @adelmemariani ?

adelmemariani commented 1 month ago

What do you think @adelmemariani ?

If you tested it and everything is working it is ok. But, shouldn't the 'bind_all_namespaces' return a graph?

jh-RLI commented 1 month ago

Further tests would certainly also be part of this branch, but in general everything has worked so far. I'm happy to help.

You're right about your comment, it's been a while, I think there was another problem.

It would be great if we could slowly make the code more modular starting with this branch.