jgsogo committed 6b87c9f Draft Merge

merge haystack v.2.0

Comments (0)

Files changed (2)


 path = os.path.join(settings.STATIC_ROOT, 'djangobb_forum', 'themes')
 if os.path.exists(path):
     # fix for collectstatic
-    THEME_CHOICES = [(theme, theme) for theme in os.listdir(path) 
+    THEME_CHOICES = [(theme, theme) for theme in os.listdir(path)
                      if os.path.isdir(os.path.join(path, theme))]
     def has_access(self, user):
         if self.groups.exists():
-            if user.is_authenticated(): 
+            if user.is_authenticated():
                     if not self.groups.filter(
                         return False
         verbose_name_plural = _('Posts')
     def save(self, *args, **kwargs):
-        self.body_html = convert_text_to_html(self.body, self.markup) 
+        self.body_html = convert_text_to_html(self.body, self.markup)
         if forum_settings.SMILES_SUPPORT and self.user.forum_profile.show_smilies:
             self.body_html = smiles(self.body_html)
         super(Post, self).save(*args, **kwargs)
 class Profile(models.Model):
     user = AutoOneToOneField(User, related_name='forum_profile', verbose_name=_('User'))
     status = models.CharField(_('Status'), max_length=30, blank=True)
-    site = models.URLField(_('Site'), verify_exists=False, blank=True)
+    site = models.URLField(_('Site'), blank=True)
     jabber = models.CharField(_('Jabber'), max_length=80, blank=True)
     icq = models.CharField(_('ICQ'), max_length=12, blank=True)
     msn = models.CharField(_('MSN'), max_length=80, blank=True)


 from haystack.indexes import *
-from haystack import site
+from haystack import indexes
 import djangobb_forum.models as models
     category = CharField(model_attr='topic__forum__category__name')
     forum = IntegerField(model_attr='topic__forum__pk')
-site.register(models.Post, PostIndex)
+    def get_model(self):
+        return models.Post
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.