merge picture to pretty
[wolnelektury.git] / apps / catalogue / models.py
index f22c9e1..6470ebb 100644 (file)
@@ -61,7 +61,6 @@ class Tag(TagBase):
     category = models.CharField(_('category'), max_length=50, blank=False, null=False,
         db_index=True, choices=TAG_CATEGORIES)
     description = models.TextField(_('description'), blank=True)
-    main_page = models.BooleanField(_('main page'), default=False, db_index=True, help_text=_('Show tag on main page'))
 
     user = models.ForeignKey(User, blank=True, null=True)
     book_count = models.IntegerField(_('book count'), blank=True, null=True)
@@ -175,7 +174,11 @@ class Tag(TagBase):
             try:
                 tag_names = getattr(info, field_name)
             except:
-                tag_names = [getattr(info, category)]
+                try:
+                    tag_names = [getattr(info, category)]
+                except:
+                    # For instance, Pictures do not have 'genre' field.
+                    continue
             for tag_name in tag_names:
                 tag_sort_key = tag_name
                 if category == 'author':