Fakultas Ilmu Komputer UI

Commit d55fc4d8 authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

[REFACTOR] Define fields for FotoKegiatanSerializer

parent 214c1b96
......@@ -34,10 +34,11 @@ class LokasiSerializer(serializers.ModelSerializer):
class FotoKegiatanSerializer(serializers.ModelSerializer):
place_id = serializers.CharField(source='lokasi.place_id', read_only=True)
place_id = serializers.CharField(source='kegiatan.lokasi.place_id', read_only=True)
class Meta:
model = FotoKegiatan
fields = '__all__'
fields = ("id", "kegiatan", "place_id", "foto")
extra_kwargs = {
'foto': {'required': True},
'kegiatan': {'required': True},
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment