Skip to content

Commit

Permalink
pin back doglib source in pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalGawor committed Jun 11, 2024
1 parent 0f0b747 commit 28c5a1b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dogapi/dogapi/views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,4 @@ def expand_datatype(request: Request) -> Response:
@permission_classes([AllowAny])
@api_view(['GET'])
def get_all_repositories(request: Request) -> Response:
return Response(dumps(dog.get_all_repositories(), status=200))
return Response(dog.get_all_repositories(), status=200)
19 changes: 14 additions & 5 deletions dogconfig/dogproject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
SPECTACULAR_SETTINGS = {
'TITLE': 'Digital Object Gate',
'DESCRIPTION': 'DOG API resolving referenced resources in the metadata',
'VERSION': '1.0.1',
'VERSION': '1.0.3',
'SERVE_INCLUDE_SCHEMA': False,
# OTHER SETTINGS
}
Expand Down Expand Up @@ -141,16 +141,25 @@

LOGGING = {
'version': 1,
'formatters': {
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
# existing handlers
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler'
'class': 'logging.StreamHandler',
'formatter': 'simple'
}
},
'root': {
'level': 'DEBUG',
'handlers': ['console'],
'loggers': {
'root': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': True
}
},
}
logging.config.dictConfig(LOGGING)
Expand Down
5 changes: 4 additions & 1 deletion dogui/dogui/templates/UI/_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
</ul>

OpenAPI docummentation available <a href="">here</a>

<br>
Source code for DOGlib available <a href="https://github.com/clarin-eric/DOGlib/">here</a>
<br>
Source code for DOGapp avaiable <a href="https://github.com/clarin-eric/DOGapp/">here</a>

<h3> BETA Digital Object Gate </h3>
Expand All @@ -23,6 +24,8 @@ <h3> BETA Digital Object Gate </h3>
{% endif %}
{% endblock pid_form %}
{% block result %}{% endblock result %}
<br>
<h4> Currently registered repositories within DOG </h4>
<div id="registered_repos_table">
{% block registered_repos %}
{% include 'UI/_registered_repositories_table.html' with reg_repos=reg_repos %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</tr>
{% for reg_repo in reg_repos %}
<tr>
<td><a href="{{ reg_repo.host_netloc }}"></a>{{ reg_repo.host_name }}</td>
<td><a href="{{ reg_repo.host_netloc }}">{{ reg_repo.host_name }}</a></td>
<td>{{ reg_repo.name }}</td>
</tr>
{% endfor %}
Expand Down
15 changes: 11 additions & 4 deletions dogui/dogui/views_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.template import RequestContext
import logging.config
import requests
import sys

from .forms import PIDForm
from .utils import TaxonomyTree
Expand All @@ -15,6 +16,16 @@
def home(request: HttpRequest) -> HttpResponse:
context: RequestContext = RequestContext(request)
pid_form: PIDForm() = PIDForm(request.GET)

all_registered_repos_url = API_NETLOC + "/allregrepo"
all_registered_repos_response = requests.get(all_registered_repos_url)

print("$$$$$$$$$$$$$$$$$$", file=sys.stderr)
print(all_registered_repos_response.json(), file=sys.stderr)
logging.debug("#########")
logging.debug(all_registered_repos_response.json())
context.push({"reg_repos": all_registered_repos_response.json()})

if pid_form.is_valid():
context.push({"pid_form": pid_form})
functionality = pid_form.cleaned_data['functionality_field']
Expand All @@ -34,10 +45,6 @@ def home(request: HttpRequest) -> HttpResponse:
else:
context.push({f"{functionality}_response": api_response.json()})

all_registered_repos_url = API_NETLOC + "/allregrepo"
all_registered_repos_response = requests.get(all_registered_repos_url)
context.push({"reg_repos": all_registered_repos_response.json()})

return render(request, f"UI/_{functionality}.html", context.flatten())
else:
pid_form: PIDForm = PIDForm(initial={'functionality_field': 'sniff'})
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ homepage = ""
repository = "https://github.com/clarin-eric/DOGapp/"

[tool.poetry.dependencies]
# doglib = { url = "https://github.com/clarin-eric/DOGlib/releases/download/1.0.6/doglib-1.0.6-py3-none-any.whl" }
doglib = { url = "https://github.com/clarin-eric/DOGlib/releases/download/1.0.7-rc1/doglib-1.0.7rc1-py3-none-any.whl" }
Django = '4.2.11'
django-cors-headers = '>=4.3.1'
django-debug-toolbar = '4.3.0'
Expand Down

0 comments on commit 28c5a1b

Please sign in to comment.