Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FarolDjango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PET Computação
FarolDjango
Commits
21cd1182
Commit
21cd1182
authored
6 years ago
by
omdj17
Browse files
Options
Downloads
Plain Diff
Merge branch 'development' into 'master'
usuario detail See merge request
!4
parents
c6875371
9696c9b8
Branches
tree
No related tags found
1 merge request
!4
usuario detail
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/usuario/views.py
+13
-0
13 additions, 0 deletions
src/usuario/views.py
with
13 additions
and
0 deletions
src/usuario/views.py
+
13
−
0
View file @
21cd1182
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment