Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Marta Miranda
/
boletin_api
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
Enzo Yair
2023-09-15 07:14:58 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
740bb130fbdc439c5222b6d606bc252b4693976e
740bb130
1 parent
577470f7
se agrego metodo patch
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
project/apps/edicto/api.py
project/apps/edicto/api.py
View file @
740bb13
...
...
@@ -14,7 +14,6 @@ from .utils import contador
class
EdictoViewSet
(
mixins
.
CreateModelMixin
,
mixins
.
RetrieveModelMixin
,
mixins
.
UpdateModelMixin
,
mixins
.
ListModelMixin
,
viewsets
.
GenericViewSet
):
...
...
@@ -36,10 +35,9 @@ class EdictoViewSet(mixins.CreateModelMixin,
usuario_movimiento
=
usuario
,
)
@action
(
detail
=
True
,
methods
=
[
'patch'
])
def
custom_update
(
self
,
request
):
def
partial_update
(
self
,
request
):
instance
=
self
.
get_object
()
serializer
=
self
.
get_serializer
(
instance
,
data
=
request
.
data
)
serializer
=
self
.
get_serializer
(
instance
,
data
=
request
.
data
,
partial
=
True
)
serializer
.
is_valid
(
raise_exception
=
True
)
edicto
=
request
.
data
.
get
(
'cuerpo_edicto'
)
...
...
Please
register
or
login
to post a comment