Change how we determine default 'grid key' for master views

This commit is contained in:
Lance Edgar 2016-11-10 17:13:29 -06:00
parent 43eb2f107f
commit 7dd19c6d87

View file

@ -694,8 +694,10 @@ class MasterView(View):
Returns the unique key to be used for the grid, for caching sort/filter
options etc.
"""
# TODO: default here should probably come from route_prefix instead?
return getattr(cls, 'grid_key', '{0}s'.format(cls.get_normalized_model_name()))
if hasattr(cls, 'grid_key'):
return cls.grid_key
# default previously came from cls.get_normalized_model_name() but this is hopefully better
return cls.get_route_prefix()
def make_grid_kwargs(self, **kwargs):
"""