10
我有這樣的錯誤:Django。此函數的無效關鍵字參數。多對多
'人' 是這個函數
class Passage(models.Model):
name= models.CharField(max_length = 255)
who = models.ForeignKey(UserProfil)
class UserPassage(models.Model):
passage = models.ForeignKey(Passage)
people = models.ManyToManyField(UserProfil, null=True)
class UserProfil(models.Model):
user = models.OneToOneField(User)
name = models.CharField(max_length=50)
我嘗試了無效的關鍵字參數:
def join(request):
user = request.user
user_profil = UserProfil.objects.get(user=user)
passage = Passage.objects.get(id=2)
#line with error
up = UserPassage.objects.create(people= user_profil, passage=passage)
return render_to_response('thanks.html')
怎樣一個人準確地做到這一點?謝謝!