-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: redesign-staging
Are you sure you want to change the base?
Conversation
uvdat/core/tasks/networks.py
Outdated
@@ -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', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added numbering to avoid name conflicts in 93f7e45
uvdat/core/rest/networks.py
Outdated
gcc = network.get_gcc(excluded_nodes=exclude_nodes) | ||
return Response(gcc, status=200) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a custom serializer to validate gcc results in 98e1d2b
|
||
def get_dataset_name(self, obj): | ||
return obj.dataset.name | ||
list_display = ['id', 'category'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the dataset name? Is it not something administrators would want to see in this view?
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).