Skip to content
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

Additional API updates #103

Open
wants to merge 3 commits into
base: redesign-staging
Choose a base branch
from
Open

Conversation

annehaley
Copy link
Collaborator

@annehaley annehaley commented Feb 14, 2025

In the course of continuing UI updates on #102, I found some more server-side changes that are needed to use the new Network model in our API. This includes an update to the new TokenAuth class and a new set of viewpoints for Networks. The client will now leverage these endpoints for Network-related logic (rather than going through Dataset endpoints, since the relationship between a Network and a Dataset is no longer one-to-one).

@annehaley annehaley marked this pull request as ready for review February 14, 2025 19:59
@annehaley annehaley requested a review from jjnesbitt February 14, 2025 20:00
@annehaley annehaley changed the title Additional API updates: Network Viewset Additional API updates Feb 18, 2025
@annehaley annehaley requested a review from floryst February 18, 2025 20:46
@@ -25,6 +25,7 @@ def create_network(vector_data, network_options):
dataset = vector_data.dataset
Network.objects.filter(vector_data__dataset=dataset).delete()
network = Network.objects.create(
name=dataset.name + ' Network',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we currently constraining Networks to be one-to-one with datasets?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, do you think that we should add numbering to this name string to account for multi-network datasets?

Comment on lines +33 to +34
gcc = network.get_gcc(excluded_nodes=exclude_nodes)
return Response(gcc, status=200)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably best to use a serializer here, but I understand this is just relocated code. Not a huge deal imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants