Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
docs/_build

.DS_Store
9 changes: 8 additions & 1 deletion articles/modules/category/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,16 @@ class Meta:
def __str__(self):
return self.name

# FIXME: urls refers to views that are not CB as in views.py
# @app_models.permalink
# def get_absolute_url(self):
# return ('article_category', 'articles.urls', (self.local_url,))
@app_models.permalink
def get_absolute_url(self):
return ('article_category', 'articles.urls', (self.local_url,))
return ('article_detail', 'articles.urls', (), {
'category_url': self.local_url,
'slug': self.slug,
})

mptt.register(Category)

Expand Down
7 changes: 1 addition & 6 deletions articles/templatetags/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,12 @@ def render(self, context):
articles = self.articles and self.articles.resolve(context)
limit = self.limit and self.limit.resolve(context)


if articles is None:
user = None
if 'request' in context:
user = context['request'].user
articles = Article.objects.active(user=user).select_related()
articles = Article.objects.active().select_related()

if limit is not None:
articles = articles[:limit]


if self.varname is not None:
context[self.varname] = articles
return ''
Expand Down