123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <<<<<<< HEAD
- from .models import Facultad, Curso, Matricula
- =======
- from .models import Facultad, Curso, Matricula, ProximoSemestre
- >>>>>>> Suazo
- from rest_framework import serializers
-
-
- class FacultadSerializer(serializers.ModelSerializer):
- class Meta:
- model = Facultad
- fields = ('__all__')
-
- def create(self, validated_data):
- instance, created = Facultad.objects.get_or_create(**validated_data)
- # print(instance, created)
- if(created == False):
- print('ya se creo')
- return validated_data
-
-
- class CursoSerializer(serializers.ModelSerializer):
- class Meta:
- model = Curso
- fields = ('__all__')
-
- def create(self, validated_data):
- instance, created = Curso.objects.get_or_create(**validated_data)
- # print(instance, created)
- if(created == False):
- print('ya se creo')
- return validated_data
-
-
- class MatriculaSerializer(serializers.ModelSerializer):
- class Meta:
- <<<<<<< HEAD
- model = Curso
- =======
- model = Matricula
- >>>>>>> Suazo
- fields = ('__all__')
-
- def create(self, validated_data):
- instance, created = Matricula.objects.get_or_create(**validated_data)
- # print(instance, created)
- if(created == False):
- print('ya se creo')
- return validated_data
- <<<<<<< HEAD
- =======
-
-
- class ProximoSemestreSerializer(serializers.ModelSerializer):
- class Meta:
- model = ProximoSemestre
- fields = ('__all__')
-
- def create(self, validated_data):
- instance, created = ProximoSemestre.objects.get_or_create(
- **validated_data)
- # print(instance, created)
- if(created == False):
- print('ya se creo')
- return validated_data
- >>>>>>> Suazo
|