Mercurial > hg > toolbox
comparison toolbox/dispatcher.py @ 14:d66c25418f43
py3
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 24 Nov 2020 13:12:40 -0800 |
parents | 394648c67478 |
children |
comparison
equal
deleted
inserted
replaced
13:2d05ad362637 | 14:d66c25418f43 |
---|---|
49 setattr(self, key, kw.pop(key, self.defaults[key])) | 49 setattr(self, key, kw.pop(key, self.defaults[key])) |
50 if self.item_plural is None: | 50 if self.item_plural is None: |
51 self.item_plural = self.item_name + 's' | 51 self.item_plural = self.item_name + 's' |
52 | 52 |
53 # should templates be reloaded? | 53 # should templates be reloaded? |
54 if isinstance(self.reload, basestring): | 54 if isinstance(self.reload, str): |
55 self.reload = self.reload.lower() == 'true' | 55 self.reload = self.reload.lower() == 'true' |
56 | 56 |
57 # model: backend storage and associated methods | 57 # model: backend storage and associated methods |
58 if 'fields' in kw and isinstance(kw['fields'], basestring): | 58 if 'fields' in kw and isinstance(kw['fields'], str): |
59 # split fields if given as a string | 59 # split fields if given as a string |
60 kw['fields'] = strsplit(kw['fields']) | 60 kw['fields'] = strsplit(kw['fields']) |
61 if hasattr(self.model_type, '__call__'): | 61 if hasattr(self.model_type, '__call__'): |
62 model = self.model_type | 62 model = self.model_type |
63 elif self.model_type in models: | 63 elif self.model_type in models: |