Commits

Guilherme Gondim committed 0b85b5b Merge

Merged up.

--HG--
branch : testsuite

Comments (0)

Files changed (2)

 from django.utils.translation import ugettext_lazy as _
 
 from diario.managers import PublishedManager, CurrentSitePublishedManager
-from diario.settings import DIARIO_DEFAULT_MARKUP_LANG, HAS_TAG_SUPPORT, MARKUP_CHOICES
+from diario.settings import (DIARIO_MARKUP_CHOICES, DIARIO_DEFAULT_MARKUP_LANG,
+                             HAS_TAG_SUPPORT)
 
 
 if HAS_TAG_SUPPORT:
     from tagging.fields import TagField
 
+
 class Entry(models.Model):
     """A weblog entry."""
 
         _('markup language'),
         default=DIARIO_DEFAULT_MARKUP_LANG,
         max_length=8,
-        choices=MARKUP_CHOICES,
+        choices=DIARIO_MARKUP_CHOICES,
         help_text=_('Select "Raw text" to enter HTML or apply markup '
                     'elsewhere.'),
     )

diario/settings.py

 """
 Default Diário application settings.
 
-If you not configure the settings below in your own project settings.py,
-they assume default values::
+If you do not configure the settings below in your own project settings.py,
+they will assume default values::
+
+    DIARIO_MARKUP_CHOICES
+        Avaialable choices of markup languages for a entry.
+        Default: (('markdown', 'Markdown'), ('rest', 'reStructuredText'),
+                  ('textile',  'Textile'),  ('raw', _('Raw text')))
 
     DIARIO_DEFAULT_MARKUP_LANG
-        Markup language for blog entries. Options: 'rest', 'textile',
-        'markdown' or 'raw' for raw text.
+        Default markup language for blog entries.
+        Options: 'rest', 'textile', 'markdown' or 'raw' for raw text.
         Default: 'raw'.
 
     DIARIO_NUM_LATEST
 #  DON'T EDIT THESE VALUES, CONFIGURE IN YOUR OWN PROJECT settings.py
 #
 
-DIARIO_DEFAULT_MARKUP_LANG = getattr(settings, 'DIARIO_DEFAULT_MARKUP_LANG',
-                                     'raw')
+DIARIO_MARKUP_CHOICES = getattr(settings, 'DIARIO_MARKUP_CHOICES', (
+    ('markdown', 'Markdown'),
+    ('rest',     'reStructuredText'),
+    ('textile',  'Textile'),
+    ('raw',      _('Raw text')),
+))
+DIARIO_DEFAULT_MARKUP_LANG = getattr(settings, 'DIARIO_DEFAULT_MARKUP_LANG', 'raw')
 DIARIO_NUM_LATEST = getattr(settings, 'DIARIO_NUM_LATEST', 10)
 
 
 # django-tagging support
-#try:
-#    get_app('tagging')
-#    HAS_TAG_SUPPORT = True
-#except ImproperlyConfigured:
-HAS_TAG_SUPPORT = getattr(settings, 'HAS_TAG_SUPPORT', False)
-
-MARKUP_CHOICES = getattr(settings, 'DIARIO_MARKUP_CHOICES', (
-        ('markdown', 'Markdown'),
-        ('rest',     'reStructuredText'),
-        ('textile',  'Textile'),
-        ('raw',      _('Raw text')),
-        )
-        )
-
+try:
+    get_app('tagging')
+    HAS_TAG_SUPPORT = True
+except ImproperlyConfigured:
+    HAS_TAG_SUPPORT = False