Пример #1
0
 def get_context_data(self, **kwargs):
     context = super(IncidentCreate, self).get_context_data(**kwargs)
     context['now'] = timezone.now()
     context['page_title'] = 'Nuevo Incidente'
     context['breadcrumbs'] = utils.get_breadcrumbs_from_url(
         self.request.get_full_path())
     success_url = reverse_lazy('incident_list')
     return context
Пример #2
0
 def get_context_data(self, **kwargs):
     # Call the base implementation first to get a context
     context = super(MachineDetail, self).get_context_data(**kwargs)
     context['page_title'] = 'Detalle Máquina'
     context['breadcrumbs'] = utils.get_breadcrumbs_from_url(
         self.request.get_full_path())
     # Add in a QuerySet of all the books
     context['SoftwareComponent'] = SoftwareComponent.objects.filter(
         machine=self.object.pk)
     context['HardwareComponent'] = HardwareComponent.objects.filter(
         machine=self.object.pk)
     return context
Пример #3
0
 def get_context_data(self, **kwargs):
     context = super(MachineListView, self).get_context_data(**kwargs)
     context['now'] = timezone.now()
     context['page_title'] = 'Inventario'
     context['breadcrumbs'] = utils.get_breadcrumbs_from_url(
         self.request.get_full_path())
     if self.request.user.is_superuser:
         context['object_list'] = Machine.objects.all()
     elif self.request.user.tipo_usuario == 'CLIENTE' or self.request.user.tipo_usuario == 'CLIENTE_ADMIN':
         context['object_list'] = Machine.objects.filter(
             company=self.request.user.company.pk)
     elif self.request.user.tipo_usuario == 'TECNICO':  # falta implementar logica para buscar machinas asignadas a los tickets
         context['object_list'] = Machine.objects.filter(
             company=self.request.user.company.pk)
     else:
         context['object_list'] = []
     #print(self.request.__dict__)
     return context
Пример #4
0
 def get_context_data(self, **kwargs):
     context = super(IndexView, self).get_context_data(**kwargs)
     context['page_title'] = 'Dashboard'
     context['breadcrumbs'] = utils.get_breadcrumbs_from_url(
         self.request.get_full_path())
     return context