Showing
1 changed file
with
12 additions
and
1 deletions
1 | from rest_framework_json_api import serializers | 1 | from rest_framework_json_api import serializers |
2 | 2 | ||
3 | -from .models import Evento | 3 | +from .models import Evento, FechaEvento |
4 | +from organismo.serializers import OrganismoSerializer, DependenciaSerializer | ||
5 | + | ||
6 | + | ||
7 | +class FechaEventoSerializer(serializers.ModelSerializer): | ||
8 | + class Meta: | ||
9 | + model = FechaEvento | ||
10 | + fields = serializers.ALL_FIELDS | ||
4 | 11 | ||
5 | 12 | ||
6 | class EventoSerializer(serializers.ModelSerializer): | 13 | class EventoSerializer(serializers.ModelSerializer): |
14 | + organismo = OrganismoSerializer(many=True, read_only=True) | ||
15 | + dependencia = DependenciaSerializer(many=True, read_only=True) | ||
16 | + fechas = FechaEventoSerializer(many=True, read_only=True) | ||
17 | + | ||
7 | class Meta: | 18 | class Meta: |
8 | model = Evento | 19 | model = Evento |
9 | fields = ( | 20 | fields = ( |
-
Please register or login to post a comment