Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Martín Miranda
/
capacitacion_django
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Cecilia
2021-09-30 13:16:15 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f808a5582ba33dfadf3e1bfb862620fcbb3dcadb
f808a558
1 parent
a818e7e9
apis
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
persona/api.py
persona/models.py
persona/api.py
View file @
f808a55
from
django_filters.rest_framework
import
DjangoFilterBackend
from
rest_framework
import
viewsets
,
filters
from
rest_framework.permissions
import
IsAuthenticated
from
rest_framework
import
viewsets
from
rest_framework.permissions
import
IsAuthenticated
,
DjangoModelPermissions
from
persona.filters
import
PersonaFilter
from
persona.models
import
Persona
...
...
@@ -12,5 +12,5 @@ class PersonaViewSet(viewsets.ModelViewSet):
serializer_class
=
PersonaSerializer
filterset_class
=
PersonaFilter
filter_backends
=
[
DjangoFilterBackend
]
permission_classes
=
(
IsAuthenticated
,)
permission_classes
=
(
IsAuthenticated
,
DjangoModelPermissions
)
...
...
persona/models.py
View file @
f808a55
...
...
@@ -30,6 +30,5 @@ class Agente(Persona):
identificador
=
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
unique
=
True
,
editable
=
False
)
def
__str__
(
self
):
return
f
'{self.identificador}'
...
...
Please
register
or
login
to post a comment