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
Empty file added src/api/contrib/__init__.py
Empty file.
131 changes: 131 additions & 0 deletions src/api/contrib/samples.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
@CurrentHost = http://localhost:8000

# @name location-fetch
POST {{CurrentHost}}/contrib/data
Accept: application/json
Content-Type: application/json
Accept-Language: en-US,en;q=0.5

{
"single": {
"query": {
"model": "geo.Location",
"filter": []
},
"fields": [
"name",
"value"
]
}
}

###

# @name nationality
POST {{CurrentHost}}/contrib/data
Accept: application/json
Content-Type: application/json
Accept-Language: en-US,en;q=0.5

{
"single": {
"query": {
"model": "voyage_nationality",
"filter": []
},
"fields": [
"name"
]
}
}

###

# @name single-voyage
POST {{CurrentHost}}/contrib/data
Accept: application/json
Content-Type: application/json
Accept-Language: en-US,en;q=0.5

{
"q1": {
"query": {
"model": "voyage_voyage",
"filter": [ { "field": "voyage_id", "value": "1" } ]
},
"fields": [ "voyage_id", "dataset" ]
}
}

###

# @name multiple-queries
POST {{CurrentHost}}/contrib/data
Accept: application/json
Content-Type: application/json
Accept-Language: en-US,en;q=0.5

{
"q47": {
"query": {
"model": "past_enslaveralias",
"filter": [
{
"field": "id",
"value": 1035662
}
]
},
"fields": [
"alias",
"identity_id",
"id"
]
},
"q48": {
"query": {
"model": "past_enslaverinrelation_roles",
"filter": [
{
"field": "enslaverinrelation_id",
"value": 1080
}
]
},
"fields": [
"enslaverinrelation_id",
"enslaverrole_id",
"id"
]
}
}

###

# @name VoyageSources
POST {{CurrentHost}}/contrib/data
Accept: application/json
Content-Type: application/json
Accept-Language: en-US,en;q=0.5

{
"q1": {
"query": {
"model": "document_source",
"filter": []
},
"fields": [
"title",
"short_ref",
"bib",
"notes"
]
}
}

###

# @name location_tree
GET {{CurrentHost}}/contrib/location_tree

###
10 changes: 10 additions & 0 deletions src/api/contrib/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.urls import path
from .views import batch_data_api, location_tree, publish_batch, publication_status

urlpatterns = [
path('data', batch_data_api, name='contrib_data_api'),
path('location_tree', location_tree, name='location_tree'),
path('publish_batch', publish_batch, name='publish_batch'),
# Updated to capture publication_key from the URL: /publication_status/<key>
path('publication_status/<str:publication_key>', publication_status, name='publication_status'),
]
Loading