Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions specifyweb/backend/attachment_gw/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,50 @@ def proxy(request):
(chunk for chunk in response.iter_content(512 * 1024)),
content_type=response.headers['Content-Type'])

@openapi(schema={
"post": {
"requestBody": {
"required": True,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"attachmentlocations": {
"type": "array",
"items": {"type": "string"},
"description": "URL locations of the attachments to download",
},
"origfilenames": {
"type": "array",
"items": {"type": "string"},
"description": "Original attachment filenames of the attachments to be downloaded",
},
"recordsetid": {
"type": "integer",
"description": "Optional. Will download all attachmends in the recordset. Using this will ignore all other properties.",
},
},
"required": ["attachmentlocations", "origfilenames"],
}
}
}
},
"responses": {
"200": {
"description": "A zip file containing all requested attachments.",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary",
}
}
},
},
}
}
})
@require_POST
@login_maybe_required
@never_cache
Expand Down
43 changes: 42 additions & 1 deletion specifyweb/backend/series/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,49 @@

from specifyweb.specify.api.crud import get_model
from specifyweb.specify.utils.uiformatters import get_uiformatter_by_name
from specifyweb.specify.views import login_maybe_required
from specifyweb.specify.views import login_maybe_required, openapi

@openapi(schema={
"post": {
"requestBody": {
"required": True,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"rangestart": {"type": "string", "description": "Start value of the range"},
"rangeend": {"type": "string", "description": "End value of the range"},
"tablename": {"type": "string", "description": "Table being used (E.g. CollectionObject)"},
"fieldname": {"type": "string", "description": "Field name being numbered"},
"formattername": {"type": "string", "description": "UIFormatter name for field"},
"skipstartnumber": {"type": "boolean", "description": "If true, omit the start value from returned list"}
},
"required": ["rangestart", "rangeend", "tablename", "fieldname", "formattername"]
}
}
}
},
"responses": {
"200": {
"description": "List of generated values, along with information about existing numbers and an error message, if any.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"values": {"type": "array", "items": {"type": "string"}},
"existing": {"type": "array", "items": {"type": "string"}},
"error": {"type": "string"}
},
"required": ["values"]
}
}
}
},
}
}
})
@login_maybe_required
@require_POST
def series_autonumber_range(request: http.HttpRequest):
Expand Down
Loading