title: How to create an object inside a GET request in a DRF APIview?
body: <p>I am writing an API for a game using APIView for the view and I need to create a game round and game session object in the GET request. The goal is that when a user clicks on the game, a game session consisting of a few rounds is created every time. Let's say a game session only consists of one round.</p>
  <p>How do I properly create those objects in the get method? Do I assign something to every field? Do I use the save or should I override the create() Method for both?</p>
  <p>This what I have so far:</p>
  <p><strong>views.py</strong></p>
  <pre><code>    def get(self, request, *args, **kwargs):
  controller = GameViewController()
          gametype = Gametype.objects.all().filter(name=&quot;imageLabeler&quot;)
          gametype_serializer = GametypeSerializer(gametype, many=True)
  
          # while duration is not None:
          random_resource = Resource.objects.all().order_by('?').first()
          resource_serializer = ResourceSerializer(random_resource)
  
                  if request.user is None:
              current_user = '1'
          else:
              current_user = request.user
  
          current_score = 0
  
          gamesession = Gamesession.save({
              'id': controller.generate_random_id(Gamesession),
              'user': current_user,
              'gametype': gametype,
              'created': datetime.now(),
          })
  
          gameround = Gameround.save({
              'id': controller.generate_random_id(Gameround),
              'user': current_user,
              'gamesession': gamesession,
              'created': datetime.now(),
              'score': current_score,
          })
  
          return Response({'gametype': gametype_serializer.data,
                           'resource': resource_serializer.data
                           })
  </code></pre>
  <p>These are my models:
  <strong>models.py</strong></p>
  <pre><code>class Gamesession(models.Model):
      user = models.ForeignKey(CustomUser, on_delete=models.SET_NULL, null=True)
      gametype = models.ForeignKey(Gametype, on_delete=models.CASCADE)
      created = models.DateTimeField(editable=False)
  
      objects = models.Manager()
  
      def save(self, *args, **kwargs):
          if not self.id:
              self.created = timezone.now()
  
          return super().save(*args, **kwargs)
  
  
  class Gameround(models.Model):
      user = models.ForeignKey(CustomUser, on_delete=models.SET_NULL, null=True)
      gamesession = models.ForeignKey(Gamesession, on_delete=models.CASCADE)
      created = models.DateTimeField(editable=False)
      score = models.PositiveIntegerField(default=0)
  
      objects = models.Manager()
  
      def save(self, *args, **kwargs):
          if not self.id:
              self.created = timezone.now()
  
          return super().save(*args, **kwargs)
  </code></pre>