Forked from bismarck4lves/gist:5d8d2f97200087b0c0bb784fd92fc9df
Last active
April 12, 2020 21:49
-
-
Save walison17/f15495955a02182b5c47cda455e5acc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MarcacaoSerializer(serializers.ModelSerializer): | |
agenda = AgendasSerializer(read_only=True) | |
agenda_id = serializers.PrimaryKeyRelatedField(write_only=True) | |
class Meta: | |
model = Consultas | |
fields = ['id', 'agenda', 'agenda_id', horario', 'data_agendamento'] | |
def create(self, validated_data): | |
# validacoes ... | |
... | |
payload = { | |
"agenda_id": 1, | |
"horario": "02:04" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment