diff options
author | Dougal Matthews <dougal@redhat.com> | 2016-01-21 15:12:37 +0000 |
---|---|---|
committer | Dougal Matthews <dougal@redhat.com> | 2016-01-22 11:26:13 +0000 |
commit | 31e0bb84f6a412777a69781d1e6438b56a28c64b (patch) | |
tree | ab01e5cb768eb3aaafde357c9ade50976c202d0a /tuskar_ui/infrastructure/views.py | |
parent | 0a5b41bad6424fa1bef17bdbb964867832d2bdfb (diff) | |
download | tuskar-ui-31e0bb84f6a412777a69781d1e6438b56a28c64b.tar.gz |
Retire the Tuskar UI codebase
Change-Id: I469fdc1339d4991586bf2e1d62d99fd5b68289eb
Depends-On: I904b2f27591333e104bf9080bb8c3876fcb3596c
Diffstat (limited to 'tuskar_ui/infrastructure/views.py')
-rw-r--r-- | tuskar_ui/infrastructure/views.py | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/tuskar_ui/infrastructure/views.py b/tuskar_ui/infrastructure/views.py deleted file mode 100644 index b22aade3..00000000 --- a/tuskar_ui/infrastructure/views.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf8 -*- -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from horizon.utils import memoized - -from tuskar_ui import api - - -class ItemCountMixin(object): - def get_items_count(self): - return len(self.get_data()) - - def get_context_data(self, **kwargs): - context = super(ItemCountMixin, self).get_context_data(**kwargs) - context['items_count'] = self.get_items_count() - return context - - -class StackMixin(object): - @memoized.memoized - def get_plan(self): - return api.tuskar.Plan.get_the_plan(self.request) - - @memoized.memoized - def get_stack(self): - return api.heat.Stack.get_by_plan(self.request, self.get_plan()) - - -class RoleMixin(object): - @memoized.memoized - def get_role(self, redirect=None): - role_id = self.kwargs['role_id'] - role = api.tuskar.Role.get(self.request, role_id, - _error_redirect=redirect) - return role |