Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Michael Coughlin
GraceDB Server
Commits
55e1205f
Commit
55e1205f
authored
12 years ago
by
Brian Moe
Browse files
Options
Downloads
Patches
Plain Diff
minor mods
parent
e355334e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gracedb/api.py
+11
-23
11 additions, 23 deletions
gracedb/api.py
with
11 additions
and
23 deletions
gracedb/api.py
+
11
−
23
View file @
55e1205f
...
@@ -7,7 +7,7 @@ from django.conf import settings
...
@@ -7,7 +7,7 @@ from django.conf import settings
import
simplejson
import
simplejson
from
gracedb.models
import
Event
from
gracedb.models
import
Event
,
Group
import
os
import
os
import
urllib
import
urllib
...
@@ -82,6 +82,7 @@ def eventToDict(event, columns=None, request=None):
...
@@ -82,6 +82,7 @@ def eventToDict(event, columns=None, request=None):
}
}
return
rv
return
rv
class
EventList
(
APIView
):
class
EventList
(
APIView
):
"""
"""
This resource represents the candidate events in GraceDB.
This resource represents the candidate events in GraceDB.
...
@@ -135,8 +136,9 @@ class EventList(APIView):
...
@@ -135,8 +136,9 @@ class EventList(APIView):
limit
=
request
.
QUERY_PARAMS
.
get
(
"
limit
"
,
PAGINATE_BY
)
limit
=
request
.
QUERY_PARAMS
.
get
(
"
limit
"
,
PAGINATE_BY
)
page
=
request
.
QUERY_PARAMS
.
get
(
"
page
"
,
1
)
page
=
request
.
QUERY_PARAMS
.
get
(
"
page
"
,
1
)
orderby
=
request
.
QUERY_PARAMS
.
get
(
"
orderby
"
,
"
-created
"
)
orderby
=
request
.
QUERY_PARAMS
.
get
(
"
orderby
"
,
"
-created
"
)
if
query
is
not
None
:
if
query
:
return
Response
(
"
Query not implemented
"
)
return
Response
(
"
Query not implemented
"
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
page
=
int
(
page
)
page
=
int
(
page
)
limit
=
int
(
limit
)
limit
=
int
(
limit
)
first
=
(
page
-
1
)
*
limit
first
=
(
page
-
1
)
*
limit
...
@@ -162,7 +164,8 @@ class EventList(APIView):
...
@@ -162,7 +164,8 @@ class EventList(APIView):
rv
=
{}
rv
=
{}
form
=
CreateEventForm
(
request
.
POST
,
request
.
FILES
)
form
=
CreateEventForm
(
request
.
POST
,
request
.
FILES
)
# XXX Implement this please.
# XXX Implement this please.
return
Response
(
"
not yet
"
)
return
Response
(
"
Event creation not implemented yet.
"
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
if
form
.
is_valid
():
if
form
.
is_valid
():
rv
[
'
valid
'
]
=
True
rv
[
'
valid
'
]
=
True
...
@@ -203,12 +206,12 @@ def eventLogToDict(log, n=None, request=None):
...
@@ -203,12 +206,12 @@ def eventLogToDict(log, n=None, request=None):
uri
=
reverse
(
"
eventlog-detail
"
,
args
=
[
log
.
event
.
graceid
(),
n
],
request
=
request
)
uri
=
reverse
(
"
eventlog-detail
"
,
args
=
[
log
.
event
.
graceid
(),
n
],
request
=
request
)
else
:
else
:
uri
=
""
uri
=
""
return
[
{
return
{
"
comment
"
:
log
.
comment
,
"
comment
"
:
log
.
comment
,
"
created
"
:
log
.
created
,
"
created
"
:
log
.
created
,
"
issuer
"
:
log
.
issuer
.
name
,
"
issuer
"
:
log
.
issuer
.
name
,
"
self
"
:
uri
,
"
self
"
:
uri
,
}]
}
class
EventLogList
(
APIView
):
class
EventLogList
(
APIView
):
authentication_classes
=
(
LigoAuthentication
,)
authentication_classes
=
(
LigoAuthentication
,)
...
@@ -266,25 +269,10 @@ class GracedbRoot(APIView):
...
@@ -266,25 +269,10 @@ class GracedbRoot(APIView):
"
event-log-template
"
:
log
,
"
event-log-template
"
:
log
,
"
files-template
"
:
files
,
"
files-template
"
:
files
,
"
filemeta-template
"
:
filemeta
,
"
filemeta-template
"
:
filemeta
,
"
groups
"
:
[
group
.
name
for
group
in
Group
.
objects
.
all
()],
"
analysis-types
"
:
dict
(
Event
.
ANALYSIS_TYPE_CHOICES
),
})
})
def
papi_root
(
request
):
"""
the api root
"""
return
HttpResponse
(
"""
<html>
<head>
</head>
<body>
O Hai. %s<br/>%s
</body>
</html>
"""
%
(
django_reverse
(
'
event-list
'
),
django_reverse
(
'
event-detail
'
,
args
=
[
"
G12
"
]),
))
#""" % reverse('download', kwargs={"graceid":"G12", "filename":"FLED_THE_FILER"}))
#""" % reverse(download, args=["G12", "FRED_THE_FILE"]))
##################################################################
##################################################################
# Old. Must support this.
# Old. Must support this.
def
download
(
request
,
graceid
,
filename
=
""
):
def
download
(
request
,
graceid
,
filename
=
""
):
...
...
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