Commits

Anonymous committed 981100e

Shorten category names so that category selection isn't so arduous in the admin.

  • Participants
  • Parent commits 303d328
  • Branches hacks

Comments (0)

Files changed (1)

File satchmo/apps/product/models.py

         return zip(name_list, url_list)
 
     def __unicode__(self):
-        name_list = [cat.name for cat in self._recurse_for_parents(self)]
+        def shorten(name):
+            limit = 12
+            if len(name) > limit:
+                return name[:limit] + ".."
+            return name
+        name_list = [shorten(cat.name) for cat in self._recurse_for_parents(self)]
         name_list.append(self.name)
         return self.get_separator().join(name_list)