Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-sentry
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
istina
django-sentry
Commits
06295f5d
Commit
06295f5d
authored
13 years ago
by
David Cramer
Browse files
Options
Downloads
Patches
Plain Diff
level filters are now precise
parent
fa2289fc
No related branches found
Branches containing commit
Tags
v1.13.5
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES
+4
-0
4 additions, 0 deletions
CHANGES
sentry/filters.py
+12
-12
12 additions, 12 deletions
sentry/filters.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
17 additions
and
13 deletions
CHANGES
+
4
−
0
View file @
06295f5d
1.13.5
* Level filters are now precise (they no longer show their level + messages from higher levels).
1.13.4
* Updated message details page to resemble look and feel of group details.
...
...
This diff is collapsed.
Click to expand it.
sentry/filters.py
+
12
−
12
View file @
06295f5d
...
...
@@ -64,22 +64,22 @@ class SentryFilter(object):
# This must be a string
default
=
''
show_label
=
True
def
__init__
(
self
,
request
):
self
.
request
=
request
def
is_set
(
self
):
return
bool
(
self
.
get_value
())
def
get_value
(
self
):
return
self
.
request
.
GET
.
get
(
self
.
get_query_param
(),
self
.
default
)
or
''
def
get_query_param
(
self
):
return
getattr
(
self
,
'
query_param
'
,
self
.
column
)
def
get_widget
(
self
):
return
self
.
widget
(
self
,
self
.
request
)
def
get_query_string
(
self
):
column
=
self
.
column
query_dict
=
self
.
request
.
GET
.
copy
()
...
...
@@ -88,24 +88,24 @@ class SentryFilter(object):
if
column
in
query_dict
:
del
query_dict
[
self
.
column
]
return
'
?
'
+
query_dict
.
urlencode
()
def
get_choices
(
self
):
from
sentry.models
import
FilterValue
return
SortedDict
((
l
,
l
)
for
l
in
FilterValue
.
objects
.
filter
(
key
=
self
.
column
)
\
.
values_list
(
'
value
'
,
flat
=
True
)
\
.
order_by
(
'
value
'
))
def
get_query_set
(
self
,
queryset
):
from
sentry.models
import
MessageIndex
kwargs
=
{
self
.
column
:
self
.
get_value
()}
if
self
.
column
.
startswith
(
'
data__
'
):
return
MessageIndex
.
objects
.
get_for_queryset
(
queryset
,
**
kwargs
)
return
queryset
.
filter
(
**
kwargs
)
def
process
(
self
,
data
):
"""
``self.request`` is not available within this method
"""
return
data
def
render
(
self
):
widget
=
self
.
get_widget
()
return
widget
.
render
(
self
.
get_value
())
...
...
@@ -158,9 +158,9 @@ class SiteFilter(SentryFilter):
class
LevelFilter
(
SentryFilter
):
label
=
'
Level
'
column
=
'
level
'
def
get_choices
(
self
):
return
SortedDict
((
str
(
k
),
v
)
for
k
,
v
in
settings
.
LOG_LEVELS
)
def
get_query_set
(
self
,
queryset
):
return
queryset
.
filter
(
level
__gte
=
self
.
get_value
())
return
queryset
.
filter
(
level
=
self
.
get_value
())
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
06295f5d
...
...
@@ -36,7 +36,7 @@ if sys.version_info[:2] < (2, 5):
setup
(
name
=
'
django-sentry
'
,
version
=
'
1.13.
4
'
,
version
=
'
1.13.
5
'
,
author
=
'
David Cramer
'
,
author_email
=
'
dcramer@gmail.com
'
,
url
=
'
http://github.com/dcramer/django-sentry
'
,
...
...
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