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-08-29 08:24:11 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
08d67708af9c72781fcf34417a260bb41623dcc9
08d67708
1 parent
dacfef90
correccion en filter
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
project/apps/edicto/api.py
project/apps/edicto/filters.py
project/apps/edicto/serializer.py
project/apps/edicto/api.py
View file @
08d6770
...
...
@@ -24,7 +24,7 @@ class EdictoViewSet(mixins.CreateModelMixin,
filter_backends
=
(
DjangoFilterBackend
,
filters
.
OrderingFilter
)
filterset_class
=
EdictoFilter
queryset
=
Edicto
.
objects
.
all
()
ordering_fields
=
(
'usuario__
_
usuario'
,
'estado'
,
'fecha_publicacion'
,
'id'
,)
ordering_fields
=
(
'usuario__usuario'
,
'estado'
,
'fecha_publicacion'
,
'id'
,)
ordering
=
'id'
def
perform_create
(
self
,
serializer
):
...
...
project/apps/edicto/filters.py
View file @
08d6770
...
...
@@ -5,8 +5,8 @@ from edicto.models import Edicto
class
EdictoFilter
(
filters
.
FilterSet
):
class
Meta
:
models
=
Edicto
fields
=
(
'usuario'
,
'estado'
,
'fecha_publicacion'
,
'edicto_id'
,)
model
=
Edicto
fields
=
(
'usuario'
,
'estado'
,
'fecha_publicacion'
,
'id'
,)
...
...
project/apps/edicto/serializer.py
View file @
08d6770
...
...
@@ -24,7 +24,7 @@ class EdictoSerializer(serializers.ModelSerializer):
)
included_serializers
=
{
'usuario'
:
UsuarioSerializer
,
'usuario'
:
'username.serializers.UsuarioListaSerializer'
,
}
read_only_fields
=
(
'usuario'
,
'fecha_publicacion'
,
'cantidad_palabras'
,
'fecha_creacion'
)
...
...
Please
register
or
login
to post a comment