Commits

Gregory Petukhov committed ba1a0ca

Add extra settings for Tag Cloud customization. Add tag lowercasing by default

  • Participants
  • Parent commits f38538b

Comments (0)

Files changed (4)

File feedzilla/management/commands/feedzilla_update.py

 from datetime import datetime
 
 from django.core.management.base import BaseCommand
+from django.conf import settings
 
 from feedzilla.util.parse import parse_feed
 from feedzilla.models import Feed, Post
                     try:
                         Post.objects.get(guid=entry['guid'])
                     except Post.DoesNotExist:
+                        tags = entry['tags']
+                        if settings.FEEDZILLA_TAGS_LOWERCASE:
+                            tags = set(x.lower() for x in tags)
                         post = Post(
                             feed=feed,
-                            tags=', '.join(entry['tags']),
+                            tags=', '.join(tags),
                             title=entry['title'],
                             content=entry['content'],
                             summary=entry['summary'],

File feedzilla/settings.py

 FEEDZILLA_SUMMARY_SIZE = 2000
 FEEDZILLA_SITE_TITLE = 'Yet another feedzilla site'
 FEEDZILLA_SITE_DESCRIPTION = 'Edit your settings to change that line'
+FEEDZILLA_CLOUD_STEPS = 4
+FEEDZILLA_CLOUD_MIN_COUNT = 2
+FEEDZILLA_TAGS_LOWERCASE = True

File feedzilla/templatetags/feedzilla_tags.py

 
 from django import template
 from django.utils.safestring import mark_safe
+from django.conf import settings
 
 from tagging.models import Tag
 
     Show tag cloud for specified site.
     """
 
-    tags = Tag.objects.cloud_for_model(Post, filters={'active': True})
+    tags = Tag.objects.cloud_for_model(Post, filters={'active': True},
+                                       steps=settings.FEEDZILLA_CLOUD_STEPS,
+                                       min_count=settings.FEEDZILLA_CLOUD_MIN_COUNT)
 
     return {'tags': tags,
             }
             data_files.append(os.path.join(prefix, f))
 
 setup(
-    version = '0.1.13',
+    version = '0.1.14',
     description = 'Django application for atom/rss feeds aggregation i.e. planet engine',
     author = 'Grigoriy Petukhov',
     author_email = 'lorien@lorien.name',