Wie erhalte ich die aktuell angemeldete Benutzer-ID?
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=?)