class IndexTemplateView(TemplateView): template_name = "index.html" @method_decorator(login_required, allowed_users(allowed_roles=['customer'])) def get(self, request): return render(request, self.template_name)
class UsuariosCriarTemplateView(TemplateView): template_name = "registration/cria_users.html" @method_decorator( allowed_users(allowed_roles=['admin', 'super', 'diretor'])) @method_decorator(login_required) def get(self, request): return render(request, self.template_name)
class RegistrationTemplateView(TemplateView): template_name = "registration/register.html" @method_decorator( allowed_users( allowed_roles=['admin', 'coord', 'super', 'dirigente', 'diretor'])) @method_decorator(login_required) def get(self, request): return render(request, self.template_name)
class Cadast_InstValCreateView(CreateView): template_name = "instituicao/cadast_instval.html" model = Inst_Val form_class = RegistrarInst_ValForm success_url = reverse_lazy("instituicao:lista_instval") @method_decorator(login_required) @method_decorator(allowed_users(allowed_roles=['admin', 'super'])) def get (self, request): return render(request, self.template_name)
class Cadast_InstParCreateView(CreateView): template_name = "instituicao/cadast_instpar.html" model = Inst_Par fields = '__all__' success_url = reverse_lazy("instituicao:lista_instpar") @method_decorator(allowed_users(allowed_roles=['admin', 'dirigente', 'diretor'])) @method_decorator(login_required) def get (self, request): return render(request, self.template_name)
class Cadast_DiretorParCreateView(CreateView): template_name = "instituicao/cadast_diretorpar.html" model = DiretorPar form_class = RegistrarDiretorParForm success_url = reverse_lazy("appprincipal:index") @method_decorator(login_required) @method_decorator(allowed_users(allowed_roles=['admin', 'diretor'])) def get (self, request): return render(request, self.template_name)
class Cadast_FuncionarioCreateView(CreateView): template_name = "instituicao/cadast_func.html" model = Usuario form_class = RegistrarUsuarioForm success_url = reverse_lazy("regis:usuarios") #@method_decorator(allowed_users(allowed_roles=['admin'])) @method_decorator(login_required) @method_decorator(allowed_users(allowed_roles=['admin', 'super'])) def get (self, request): return render(request, self.template_name)
class Cadast_CursoCreateView(CreateView): #funcionario template_name = "curso/cadast_curso.html" model = Curso form_class = RegistrarTipoCursoForm success_url = reverse_lazy("curso:lista_curso") @method_decorator(login_required) @method_decorator(allowed_users(allowed_roles=['funcionario', 'super', 'diretor', 'admin'])) def get (self, request): return render(request, self.template_name)
class InstituicaoTemplateView(TemplateView): template_name = "instituicao/instacesso.html" @method_decorator(allowed_users(allowed_roles=['admin', 'coord', 'super', 'dirigente', 'diretor'])) @method_decorator(login_required) def get (self, request): return render(request, self.template_name)
class CursoTemplateView(TemplateView): template_name = "curso/cursoacesso.html" @method_decorator(login_required) @method_decorator(allowed_users(allowed_roles=['funcionario', 'coord', 'super', 'dirigente', 'diretor', 'admin'])) def get (self, request): return render(request, self.template_name)