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
2d7c9870
Commit
2d7c9870
authored
Aug 19, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
children_slice is no longer queried when SHOW_MAX_CHILDREN=0
parent
55469f7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
wiki/models/urlpath.py
+1
-1
wiki/views/mixins.py
+4
-3
No files found.
wiki/models/urlpath.py
View file @
2d7c9870
...
@@ -15,7 +15,7 @@ from wiki.core.exceptions import NoRootURL, MultipleRootURLs
...
@@ -15,7 +15,7 @@ from wiki.core.exceptions import NoRootURL, MultipleRootURLs
from
wiki.models.article
import
ArticleRevision
,
ArticleForObject
,
Article
from
wiki.models.article
import
ArticleRevision
,
ArticleForObject
,
Article
from
django.contrib.contenttypes.models
import
ContentType
from
django.contrib.contenttypes.models
import
ContentType
URLPATH_PREFECTED_PROPERTIES
=
[
"parent"
,
"article__current_revision"
]
URLPATH_PREFECTED_PROPERTIES
=
[
"parent"
,
"article__current_revision"
,
"article__owner"
]
class
URLPath
(
MPTTModel
):
class
URLPath
(
MPTTModel
):
"""
"""
...
...
wiki/views/mixins.py
View file @
2d7c9870
...
@@ -12,9 +12,10 @@ class ArticleMixin(TemplateResponseMixin):
...
@@ -12,9 +12,10 @@ class ArticleMixin(TemplateResponseMixin):
self
.
urlpath
=
kwargs
.
pop
(
'urlpath'
,
None
)
self
.
urlpath
=
kwargs
.
pop
(
'urlpath'
,
None
)
self
.
article
=
article
self
.
article
=
article
self
.
children_slice
=
[]
self
.
children_slice
=
[]
for
child
in
self
.
article
.
get_children
(
max_num
=
settings
.
SHOW_MAX_CHILDREN
+
1
,
if
settings
.
SHOW_MAX_CHILDREN
>
0
:
articles__article__current_revision__deleted
=
False
):
for
child
in
self
.
article
.
get_children
(
max_num
=
settings
.
SHOW_MAX_CHILDREN
+
1
,
self
.
children_slice
.
append
(
child
)
articles__article__current_revision__deleted
=
False
):
self
.
children_slice
.
append
(
child
)
return
super
(
ArticleMixin
,
self
)
.
dispatch
(
request
,
*
args
,
**
kwargs
)
return
super
(
ArticleMixin
,
self
)
.
dispatch
(
request
,
*
args
,
**
kwargs
)
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
...
...
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