Come ottenere l'ID dell'utente attualmente connesso?
in models.py
:
class Game(models.model):
name = models.CharField(max_length=255)
owner = models.ForeignKey(User, related_name='game_user', verbose_name='Owner')
in views.py
:
gta = Game.objects.create(name="gta", owner=?)