diff --git a/Sistemas/views.py b/Sistemas/views.py index 9abaa6b..82d9919 100644 --- a/Sistemas/views.py +++ b/Sistemas/views.py @@ -148,9 +148,11 @@ class UsersConnectedList(UserPassesTestMixin,LoginRequiredMixin,ListView): return users class SistemasXCliente_ListView(UserPassesTestMixin,LoginRequiredMixin, ListView): + model = sistemas_por_cliente - paginate_by = 5 + paginate_by = 20 template_name = 'Sistemas/Xclientes/lista.html' + def test_func(self): res = self.request.user.groups.filter(name= 'admin_soft') if not res: @@ -165,6 +167,15 @@ class SistemasXCliente_DetailView(UserPassesTestMixin,LoginRequiredMixin, Detail if not res: messages.error(self.request, f'Lo sentimos. La página que buscas no está disponible, no cuentas con los permisos.') return res + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + sistemas_por_cliente = self.object + sistema = sistemas_por_cliente.id_sistema + cliente = sistemas_por_cliente.cliente + print(sistema.id, cliente.id) + context['devices'] = Device.objects.filter(sistema=sistema, client=cliente.id) + return context class SistemasxCliente_CreateView(CreateView): diff --git a/Templates/Clientes/Errores_Timbres_list.html b/Templates/Clientes/Errores_Timbres_list.html index bb37dc4..4418c6a 100644 --- a/Templates/Clientes/Errores_Timbres_list.html +++ b/Templates/Clientes/Errores_Timbres_list.html @@ -26,44 +26,7 @@ -{% if page_obj.has_other_pages %} - -{% endif %} {% endblock content %} \ No newline at end of file diff --git a/Templates/Sistemas/Xclientes/detail.html b/Templates/Sistemas/Xclientes/detail.html index a56c927..53c591c 100644 --- a/Templates/Sistemas/Xclientes/detail.html +++ b/Templates/Sistemas/Xclientes/detail.html @@ -72,16 +72,16 @@ thead {