Added flag for enable or disable comments using settings
authorEriol
Tue, 07 Sep 2010 00:30:10 +0200
changeset 54e7ca6790ed66
parent 53 7736665a690f
child 55 a91f2d1cda61
Added flag for enable or disable comments using settings
blog/conf/settings.py
blog/models.py
     1.1 --- a/blog/conf/settings.py	Tue Sep 07 00:15:46 2010 +0200
     1.2 +++ b/blog/conf/settings.py	Tue Sep 07 00:30:10 2010 +0200
     1.3 @@ -8,3 +8,5 @@
     1.4                              '/media/admin/tinymce_setup/tinymce_setup.js')
     1.5  
     1.6  BLOG_TITLE = getattr(settings, 'BLOG_TITLE', 'A nice blog!')
     1.7 +
     1.8 +BLOG_COMMENTS = getattr(settings, 'BLOG_COMMENTS', True)
     2.1 --- a/blog/models.py	Tue Sep 07 00:15:46 2010 +0200
     2.2 +++ b/blog/models.py	Tue Sep 07 00:30:10 2010 +0200
     2.3 @@ -12,6 +12,8 @@
     2.4  from akismet import Akismet
     2.5  from tagging.fields import TagField
     2.6  
     2.7 +from blog.conf import settings
     2.8 +
     2.9  
    2.10  class Category(models.Model):
    2.11      name = models.CharField(_('name'),
    2.12 @@ -78,7 +80,8 @@
    2.13      status = models.IntegerField(_('status'),
    2.14                                   choices=STATUS_CHOICES,
    2.15                                   default=DRAFT_STATUS)
    2.16 -    enable_comments = models.BooleanField(_('enable comments'), default=True)
    2.17 +    enable_comments = models.BooleanField(_('enable comments'),
    2.18 +                                          default=settings.BLOG_COMMENTS)
    2.19      featured = models.BooleanField(_('featured'), default=False)
    2.20  
    2.21      objects = models.Manager()