Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-wiki
Commits
1d4faa9b
Commit
1d4faa9b
authored
Jun 10, 2013
by
benjaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get_absolute_path added to Article model
parent
0a946c53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
wiki/models/article.py
+9
-0
No files found.
wiki/models/article.py
View file @
1d4faa9b
...
...
@@ -13,6 +13,7 @@ from wiki.core import article_markdown, permissions
from
wiki.core
import
compat
from
wiki
import
managers
from
mptt.models
import
MPTTModel
from
django.core.urlresolvers
import
reverse
class
Article
(
models
.
Model
):
...
...
@@ -174,6 +175,14 @@ class Article(models.Model):
def
clear_cache
(
self
):
cache
.
delete
(
self
.
get_cache_key
())
def
get_absolute_url
(
self
):
urlpaths
=
self
.
urlpath_set
.
all
()
if
urlpaths
.
exists
():
return
urlpaths
[
0
]
.
get_absolute_url
()
else
:
return
reverse
(
'wiki:get'
,
kwargs
=
{
'article_id'
:
self
.
id
})
class
ArticleForObject
(
models
.
Model
):
objects
=
managers
.
ArticleFkManager
()
...
...
Write
Preview
Markdown
is supported
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