1. John Costa
  2. jcosta-django-articles


Josh VanderLinden  committed 2ec9891

Updated README for article statuses. Added some more tests. Version bump.

  • Participants
  • Parent commits b7b72cc
  • Branches article_status

Comments (0)

Files changed (4)

File README.rst

View file
 * Ability to post in the future
 * Article expiration facilities
 * Articles from email
+* Article statuses--"draft" and "finished" are there by default
 * Allows articles to be written in plain text/HTML or using Markdown,
   ReStructured Text, or Textile markup
 * Related articles
 * Follow-up articles
-* Disqus comments
+* Comments by Disqus
 * Article archive, with pagination
 * Internationalization-ready
 * Detects links in articles and creates a per-article index for you
         'acknowledge': True,
+Article Statuses
+As of ``1.9.6``, you may specify the state of an article when you save it.
+This allows you to begin composing an article, save it, and come back later to
+finish it.  In the past, this behavior was handled by not setting a publish
+date for the article.  However, saving an unfinished article with a non-live
+status allows superusers to view the article on the site as though it were
+live.  In the future, I plan to allow authors to view non-live versions of
+their articles.
+The default status for an article will always be the Article Status object with
+the lowest ``ordering`` value.  This includes negative integers.  If you want
+all articles to be ``Finished`` by default, go ahead and update the
+``ordering`` on that object to be less than the ``ordering`` value for the
+``Draft`` object (and/or any others you create).
 Good luck!  Please contact me with any questions or concerns you have with the

File articles/__init__.py

View file
-__version__ = '1.9.4-pre1'
+__version__ = '1.9.6-pre1'
 The Pygments reStructuredText directive

File articles/fixtures/initial_data.json

View file
         "model": "articles.articlestatus", 
         "fields": {
             "name": "Finished",
-            "ordering": 0,
+            "ordering": 1,
             "is_live": 1

File articles/tests.py

View file
         self.assertEquals(len(Article.objects.active()), 1)
+    def test_default_status(self):
+        """Default status selection"""
+        default_status = ArticleStatus.objects.default()
+        other_status = ArticleStatus.objects.exclude(id=default_status.id)[0]
+        self.assertTrue(default_status.ordering < other_status.ordering)
     def test_tagged_article_status(self):
         """Tagged article status"""