Showing
2 changed files
with
2 additions
and
4 deletions
@@ -24,7 +24,7 @@ class EdictoViewSet(mixins.CreateModelMixin, | @@ -24,7 +24,7 @@ class EdictoViewSet(mixins.CreateModelMixin, | ||
24 | filter_backends = (DjangoFilterBackend, filters.OrderingFilter) | 24 | filter_backends = (DjangoFilterBackend, filters.OrderingFilter) |
25 | filterset_class = EdictoFilter | 25 | filterset_class = EdictoFilter |
26 | queryset = Edicto.objects.all() | 26 | queryset = Edicto.objects.all() |
27 | - ordering_fields = ('usuario', 'estado', 'fecha_publicacion', 'id',) | 27 | + ordering_fields = ('usuario___usuario', 'estado', 'fecha_publicacion', 'id',) |
28 | ordering = 'id' | 28 | ordering = 'id' |
29 | 29 | ||
30 | def perform_create(self, serializer): | 30 | def perform_create(self, serializer): |
@@ -7,12 +7,10 @@ from usuario.serializers import UsuarioSerializer | @@ -7,12 +7,10 @@ from usuario.serializers import UsuarioSerializer | ||
7 | 7 | ||
8 | 8 | ||
9 | class EdictoSerializer(serializers.ModelSerializer): | 9 | class EdictoSerializer(serializers.ModelSerializer): |
10 | - edicto_id = serializers.ReadOnlyField(source='id') | ||
11 | 10 | ||
12 | class Meta: | 11 | class Meta: |
13 | model = Edicto | 12 | model = Edicto |
14 | - fields = ('edicto_id', | ||
15 | - 'usuario', | 13 | + fields = ('usuario', |
16 | 'estado', | 14 | 'estado', |
17 | 'cuerpo_edicto', | 15 | 'cuerpo_edicto', |
18 | 'cantidad_palabras', | 16 | 'cantidad_palabras', |
-
Please register or login to post a comment