Commits

Josh VanderLinden committed a4673c6

#6 - Fixed a problem with the get_articles template tag when you only have one article created

  • Participants
  • Parent commits 4ab3dc4
  • Tags 2.0.3

Comments (0)

Files changed (3)

 *.pyc
 *.swp
 *.swo
+build/
 dist/
 django_articles.egg-info
 MANIFEST

File articles/__init__.py

-__version__ = '2.0.2'
+__version__ = '2.0.3'
 
 """
 The Pygments reStructuredText directive

File articles/templatetags/article_tags.py

 
         if self.count:
             # if we have a number of articles to retrieve, pull the first of them
-            articles = articles[:self.count]
+            articles = articles[:int(self.count)]
         else:
             # get a range of articles
             articles = articles[(int(self.start) - 1):int(self.end)]
 
         # don't send back a list when we really don't need/want one
-        if len(articles) == 1 and not self.start: articles = articles[0]
+        if len(articles) == 1 and int(self.count) == 1 and not self.start:
+            articles = articles[0]
 
         # put the article(s) into the context
         context[self.varname] = articles