Allow config to specify grid "page size" options

This commit is contained in:
Lance Edgar 2019-04-23 22:56:38 -05:00
parent 798a9893e9
commit 25c8edd81c

View file

@ -1053,7 +1053,15 @@ class Grid(object):
checked=self.checked(item)) checked=self.checked(item))
def get_pagesize_options(self): def get_pagesize_options(self):
# TODO: Make configurable or something...
# use values from config, if defined
options = self.request.rattail_config.getlist('tailbone', 'grid.pagesize_options')
if options:
options = [int(size) for size in options
if size.isdigit()]
if options:
return options
return [5, 10, 20, 50, 100, 200] return [5, 10, 20, 50, 100, 200]
def has_static_data(self): def has_static_data(self):