Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-deposit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine R. Dumont
swh-deposit
Commits
1f07d0b1
Verified
Commit
1f07d0b1
authored
7 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
views: Use class-based view to serve query
parent
a1ea2baa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
swh/deposit/urls.py
+2
-2
2 additions, 2 deletions
swh/deposit/urls.py
swh/deposit/views.py
+3
-1
3 additions, 1 deletion
swh/deposit/views.py
with
5 additions
and
3 deletions
swh/deposit/urls.py
+
2
−
2
View file @
1f07d0b1
...
...
@@ -21,12 +21,12 @@ Including another URLconf
from
django.conf.urls
import
url
from
django.contrib
import
admin
from
swh.deposit.views
import
index
,
clients
,
client
,
SWH
DepositAPI
from
swh.deposit.views
import
index
,
clients
,
client
,
SWH
ServiceDocument
urlpatterns
=
[
url
(
r
'
^admin
'
,
admin
.
site
.
urls
),
url
(
r
'
^deposit[/]+$
'
,
index
),
url
(
r
'
^deposit/clients[/]+$
'
,
clients
),
url
(
r
'
^deposit/client/(?P<client_id>[0-9]+)
'
,
client
),
url
(
r
'
^deposit/sd
'
,
SWH
DepositAPI
().
s
ervice
_d
ocument
)
url
(
r
'
^deposit/sd
'
,
SWH
S
ervice
D
ocument
.
as_view
()
)
]
This diff is collapsed.
Click to expand it.
swh/deposit/views.py
+
3
−
1
View file @
1f07d0b1
...
...
@@ -6,6 +6,7 @@
from
django.contrib.auth.models
import
User
from
django.http
import
HttpResponse
from
django.shortcuts
import
render
,
get_object_or_404
from
django.views
import
View
from
swh.core.config
import
SWHConfig
from
.auth
import
login_required
...
...
@@ -35,6 +36,7 @@ def client(request, client_id):
class
SWHDepositAPI
(
SWHConfig
):
class
SWHServiceDocument
(
SWHConfig
,
View
):
CONFIG_BASE_FILENAME
=
'
deposit/server
'
DEFAULT_CONFIG
=
{
...
...
@@ -47,7 +49,7 @@ class SWHDepositAPI(SWHConfig):
self
.
config
=
self
.
parse_config_file
()
self
.
config
.
update
(
config
)
def
service_documen
t
(
self
,
request
):
def
ge
t
(
self
,
request
):
context
=
{
'
max_upload_size
'
:
self
.
config
[
'
max_upload_size
'
],
'
verbose
'
:
self
.
config
[
'
verbose
'
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment