From 7dd19c6d87558479a33c0d67650a12644f58445a Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 10 Nov 2016 17:13:29 -0600 Subject: [PATCH] Change how we determine default 'grid key' for master views --- tailbone/views/master.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tailbone/views/master.py b/tailbone/views/master.py index 89f6e524..611e59f5 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -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): """