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 William Coughlin
GraceDB Server
Commits
0f5c43e4
Commit
0f5c43e4
authored
12 years ago
by
Branson Stephens
Browse files
Options
Downloads
Patches
Plain Diff
commented out global tag detail resource.
parent
20fe9be3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gracedb/api.py
+26
-23
26 additions, 23 deletions
gracedb/api.py
gracedb/models.py
+7
-7
7 additions, 7 deletions
gracedb/models.py
gracedb/urls_rest.py
+3
-2
3 additions, 2 deletions
gracedb/urls_rest.py
with
36 additions
and
32 deletions
gracedb/api.py
+
26
−
23
View file @
0f5c43e4
...
...
@@ -601,16 +601,18 @@ def tagToDict(tag, columns=None, request=None, event=None, n=None):
request
=
request
)
}
else
:
# Links to all events that have this tag.
rv
[
'
links
'
]
=
{
"
events
"
:
[
reverse
(
"
event-detail
"
,
args
=
[
event
.
graceid
()],
request
=
request
)
for
event
in
tag
.
getEvents
()],
"
self
"
:
reverse
(
"
tag-detail
"
,
args
=
[
tag
.
name
],
request
=
request
)
}
# XXX Unclear what the tag detail resource should be at this level.
# For now, return an empty list.
pass
# rv['links'] = {
# "events" : [reverse("event-detail",
# args=[event.graceid()],
# request=request)
# for event in tag.getEvents()],
# "self" : reverse("tag-detail",
# args=[tag.name],
# request=request)
# }
return
rv
class
TagList
(
APIView
):
...
...
@@ -628,19 +630,20 @@ class TagList(APIView):
}
return
Response
(
rv
)
class
TagDetail
(
APIView
):
"""
Tag Detail Resource
"""
authentication_classes
=
(
LigoAuthentication
,)
permission_classes
=
(
IsAuthenticated
,)
def
get
(
self
,
request
,
tagname
):
try
:
tag
=
Tag
.
objects
.
filter
(
name
=
tagname
)[
0
]
except
Tag
.
DoesNotExist
:
return
Response
(
"
Tag not found.
"
,
status
=
status
.
HTTP_404_NOT_FOUND
)
return
Response
(
tagToDict
(
tag
,
request
=
request
))
# XXX Unclear what the tag detail resource should be.
# class TagDetail(APIView):
# """Tag Detail Resource
# """
# authentication_classes = (LigoAuthentication,)
# permission_classes = (IsAuthenticated,)
#
# def get(self, request, tagname):
# try:
# tag = Tag.objects.filter(name=tagname)[0]
# except Tag.DoesNotExist:
# return Response("Tag not found.",
# status=status.HTTP_404_NOT_FOUND)
# return Response(tagToDict(tag,request=request))
class
EventTagList
(
APIView
):
"""
Event Tag List Resource
...
...
This diff is collapsed.
Click to expand it.
gracedb/models.py
+
7
−
7
View file @
0f5c43e4
...
...
@@ -283,13 +283,13 @@ class Tag(models.Model):
else
:
return
self
.
name
def
getEvents
(
self
):
# XXX Any way of doing this with filters?
# We would need to filter for a non-null intersection of the
# set of log messages in the event with the set of log
# messages in the tag.
eventlist
=
[
log
.
event
for
log
in
self
.
eventlogs
.
all
()]
return
list
(
set
(
eventlist
))
#
def getEvents(self):
#
# XXX Any way of doing this with filters?
#
# We would need to filter for a non-null intersection of the
#
# set of log messages in the event with the set of log
#
# messages in the tag.
#
eventlist = [log.event for log in self.eventlogs.all()]
#
return list(set(eventlist))
## XXX Get rid of the slots. Probably.
...
...
This diff is collapsed.
Click to expand it.
gracedb/urls_rest.py
+
3
−
2
View file @
0f5c43e4
...
...
@@ -33,8 +33,9 @@ urlpatterns = patterns('gracedb.api',
# Tag Resources
url
(
r
'
^tag/$
'
,
TagList
.
as_view
(),
name
=
'
tag-list
'
),
url
(
r
'
^tag/(?P<tagname>\w+)$
'
,
TagDetail
.
as_view
(),
name
=
'
tag-detail
'
),
# XXX unclear what the tag detail resource should be.
#url (r'^tag/(?P<tagname>\w+)$',
# TagDetail.as_view(), name='tag-detail'),
url
(
r
'
events/(?P<graceid>[GEHT]\d+)/tag/$
'
,
EventTagList
.
as_view
(),
name
=
'
eventtag-list
'
),
url
(
r
'
events/(?P<graceid>[GEHT]\d+)/tag/(?P<tagname>\w+)$
'
,
...
...
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