11from django .utils .safestring import mark_safe
2- from django .utils .translation import ugettext_lazy as _
2+ from django .utils .translation import ugettext_lazy as _ , ugettext_noop
33
4- from django_tables2 import Table , Column , LinkColumn , TemplateColumn , A
4+ from django_tables2 import Column , LinkColumn , TemplateColumn , A
55
66from oscar .core .loading import get_class , get_model
77
1010Category = get_model ('catalogue' , 'Category' )
1111
1212
13- class ProductTable (Table ):
13+ class ProductTable (DashboardTable ):
1414 title = TemplateColumn (
1515 verbose_name = _ ('Title' ),
1616 template_name = 'dashboard/catalogue/product_row_title.html' ,
@@ -37,6 +37,8 @@ class ProductTable(Table):
3737 template_name = 'dashboard/catalogue/product_row_actions.html' ,
3838 orderable = False )
3939
40+ icon = "sitemap"
41+
4042 class Meta (DashboardTable .Meta ):
4143 model = Product
4244 fields = ('upc' , 'date_updated' )
@@ -45,7 +47,7 @@ class Meta(DashboardTable.Meta):
4547 order_by = '-date_updated'
4648
4749
48- class CategoryTable (Table ):
50+ class CategoryTable (DashboardTable ):
4951 name = LinkColumn ('dashboard:catalogue-category-update' , args = [A ('pk' )])
5052 description = TemplateColumn (
5153 template_code = '{{ record.description|default:""|striptags'
@@ -61,6 +63,10 @@ class CategoryTable(Table):
6163 template_name = 'dashboard/catalogue/category_row_actions.html' ,
6264 orderable = False )
6365
66+ icon = "sitemap"
67+ caption_singular = ugettext_noop ("{count} Category" )
68+ caption_plural = ugettext_noop ("{count} Categories" )
69+
6470 class Meta (DashboardTable .Meta ):
6571 model = Category
6672 fields = ('name' , 'description' )
0 commit comments