Answer the question
In order to leave comments, you need to log in
How to change a field in the model so that it belongs only to a specific user?
I have a progress field in the Level model.
class Level(models.Model):
level = models.CharField(max_length=50, unique=True)
helper = models.TextField(null=True, blank=True)
progress = models.IntegerField(default=0)
class LevelProgress(APIView):
def get(self, request, id):
queryset_ = Level.objects.get(pk=id)
queryset_.progress += 1
queryset_.save()
serializer = LevelFullSerializer(queryset_)
return Response(serializer.data)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question