1. tehfink
  2. cmsplugin-faq


cmsplugin-faq / cmsplugin_faq / models.py

The cms-2.X branch has multiple heads

Diff from to

File cmsplugin_faq/models.py

  • Ignore whitespace
 from django.utils.text import truncate_words
 from cms.plugins.text.utils import plugin_admin_html_to_tags, plugin_tags_to_admin_html
 from django.conf import settings
+from django.template.defaultfilters import slugify
 #get custom css from settings or use default
     css = models.CharField(_('CSS class'), max_length=1, choices=CMSPLUGIN_FAQENTRY_CSS_CHOICES, blank=True, help_text=_('Additional CSS class to apply'))
     body = models.TextField(_("body"))
+    def get_name(self):
+        return slugify(self.topic)
     def _set_body_admin(self, text):
         self.body = plugin_admin_html_to_tags(text)