Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9349288
identifiers.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
850 B
Subscribers
None
identifiers.py
View Options
# Copyright (C) 2017-2018 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
from
django.shortcuts
import
redirect
from
swh.web.common.utils
import
resolve_swh_persistent_id
from
swh.web.common.exc
import
handle_view_exception
def
swh_id_browse
(
request
,
swh_id
):
"""
Django view enabling to browse the archive using
:ref:`persistent-identifiers`.
The url that points to it is :http:get:`/(swh_id)/`.
"""
try
:
swh_id_resolved
=
resolve_swh_persistent_id
(
swh_id
,
query_params
=
request
.
GET
)
except
Exception
as
exc
:
return
handle_view_exception
(
request
,
exc
)
return
redirect
(
swh_id_resolved
[
'browse_url'
])
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Jul 4 2025, 7:15 PM (6 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3286887
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment