123456789101112131415 |
- from django.db import transaction
- from rest_framework import serializers
- from .models import *
- class MarkerSerializer(serializers.ModelSerializer):
- def create(self, validated_data):
- instance = Marker(**validated_data)
- instance.save()
- return instance
- class Meta:
- model = Marker
- fields = ("id", "timestamp", "lat", "lng", "alt", "hdop", "speed")
- read_only_fields = ("id",)
|