Commits

Konrad Rymczak committed 58db996

Name fix, haystack support

  • Participants
  • Parent commits 0462050
  • Tags 0.4.1

Comments (0)

Files changed (5)

 syntax: glob
 *.pyc
 cmsplugin_news.egg-info
-dist
+dist
+.idea/*

File cmsplugin_news/cms_app.py

 from cms.apphook_pool import apphook_pool
 
 class NewsApphook(CMSApp):
-    name = _("Latest News")
+    name = _("News")
     urls = ["cmsplugin_news.urls"]
 
 apphook_pool.register(NewsApphook)

File cmsplugin_news/search_indexes.py

+import datetime
+from haystack.indexes import *
+from haystack import site
+from models import News
+
+class NewsIndex(SearchIndex):
+    text = CharField(document=True, use_template=True)
+    pub_date = DateTimeField(model_attr='created')
+
+    def index_queryset(self):
+        return News.published.all()
+
+site.register(News, NewsIndex)

File cmsplugin_news/templates/search/indexes/cmsplugin_news/news_text.txt

+{{ object.title }}
+{{ object.content }}
 
 setup(
     name='cmsplugin-news',
-    version='0.4b',
+    version='0.4.1',
     description='This is a news app/plugin for the django-cms 2',
     author='Harro van der Klauw',
     author_email='hvdklauw@gmail.com',