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

Update HydroShare Resource in Backend #2573

Closed
rajadain opened this issue Dec 28, 2017 · 0 comments
Closed

Update HydroShare Resource in Backend #2573

rajadain opened this issue Dec 28, 2017 · 0 comments
Assignees
Labels
HydroShare Export WPF Funding Source: William Penn Foundation WPF 2-4

Comments

@rajadain
Copy link
Member

rajadain commented Dec 28, 2017

Currently, POSTing to an existing HydroShare resource simply returns the current value, instead of updating it:

# TODO POSTing to an existing export should update the resource
# Currently it is just paired with GET
# GET existing resource simply returns it
if hsresource and request.method in ['GET', 'POST']:
serializer = HydroShareResourceSerializer(hsresource)
return Response(serializer.data)

Instead, it should update the resource. Currently, it does not seem possible to update the resource via the hs_restclient, although such may be possible via the REST API itself. However, we should only need to focus on updating the files (GMS, and whatever format is decided for TR-55 projects). This can readily be done with deleteResourceFile and addResourceFile.

Optionally, the resource can also be versioned, to indicate new changes, like this:

hs.resource('RESOURCE ID').version()
@rajadain rajadain added HydroShare Export WPF Funding Source: William Penn Foundation WPF 2-4 labels Dec 28, 2017
This was referenced Dec 28, 2017
@rajadain rajadain self-assigned this Dec 28, 2017
rajadain added a commit that referenced this issue Jan 2, 2018
…te-resource

HydroShare Update Resource

Connects #2573
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HydroShare Export WPF Funding Source: William Penn Foundation WPF 2-4
Projects
None yet
Development

No branches or pull requests

2 participants