Skip to content
Snippets Groups Projects
Commit 21cd1182 authored by omdj17's avatar omdj17
Browse files

Merge branch 'development' into 'master'

usuario detail

See merge request !4
parents c6875371 9696c9b8
Branches tree
No related tags found
1 merge request!4usuario detail
......@@ -6,6 +6,7 @@ from usuario.models import Curso, Usuario
from django.urls import reverse_lazy
from django.views import generic, View
from django.contrib.auth.forms import UserCreationForm
from documento.models import Documento
# class CursoCreateView(generic.CreateView):
......@@ -33,7 +34,19 @@ from django.contrib.auth.forms import UserCreationForm
# template_name = 'CursoDelete.html'
# sucess_url = reverse_lazy('/')
#
class UsuarioDetail(generic.DetailView):
template_name = 'UsuarioDetail.html'
context_object_name = 'UsuarioDetail'
queryset = Usuario.objects.all()
def get_context_data(self, **kwargs):
# Call the base implementation first to get a context
context = super().get_context_data(**kwargs)
# Add in a QuerySet of all the books
usuario = self.request.user.usuario
context['documentos'] = Documento.objects.filter(submissao__usuario=usuario)
return context
class Admin(View):
template_name = 'UsuarioAdmin.html'
model = Usuario
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment