Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Lohninger
Respect My Net
Commits
afefbf73
Commit
afefbf73
authored
Apr 05, 2016
by
Okhin
Browse files
Fixing the get_absolute_url aprt
parent
1b0921eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
bt/models.py
View file @
afefbf73
from
django.db
import
models
from
django.core.urlresolvers
import
reverse
from
django.utils.translation
import
ugettext_lazy
as
_
from
django_comments.moderation
import
CommentModerator
,
moderator
...
...
@@ -111,10 +112,8 @@ class Violation(models.Model):
def
operator
(
self
):
return
self
.
operator_ref
.
name
@
models
.
permalink
def
get_absolute_url
(
self
):
return
(
'violation_url'
,
(),
{
'id'
:
self
.
pk
})
return
reverse
(
'violation_url'
,
args
=
(
self
.
pk
))
def
__unicode__
(
self
):
return
"#%s %s/%s"
%
(
self
.
pk
,
self
.
country
,
self
.
operator
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment