Add shared GPC search filter, use it for product batch rows.

This commit is contained in:
Lance Edgar 2015-03-07 14:19:19 -06:00
parent 51e4eda662
commit 69a5eed83b
5 changed files with 41 additions and 34 deletions

View file

@ -36,7 +36,7 @@ from rattail.util import load_object
import formalchemy
from tailbone.db import Session
from tailbone.views.batch import FileBatchGrid, FileBatchCrud, BatchRowGrid, BatchRowCrud, defaults
from tailbone.views.batch import FileBatchGrid, FileBatchCrud, ProductBatchRowGrid, BatchRowCrud, defaults
class VendorCatalogGrid(FileBatchGrid):
@ -140,7 +140,7 @@ class VendorCatalogCrud(FileBatchCrud):
return True
class VendorCatalogRowGrid(BatchRowGrid):
class VendorCatalogRowGrid(ProductBatchRowGrid):
"""
Grid view for vendor catalog rows.
"""
@ -148,11 +148,9 @@ class VendorCatalogRowGrid(BatchRowGrid):
route_prefix = 'vendors.catalogs'
def filter_map_extras(self):
return {'ilike': ['upc', 'brand_name', 'description', 'size', 'vendor_code']}
def filter_config_extras(self):
return {'filter_label_upc': "UPC",
'filter_label_brand_name': "Brand"}
map_ = super(VendorCatalogRowGrid, self).filter_map_extras()
map_.setdefault('ilike', []).append('vendor_code')
return map_
def configure_grid(self, g):
g.configure(