From 3e3f0e9f4999e2acc6762e738068f9062ba96723 Mon Sep 17 00:00:00 2001 From: Basile Clement Date: Tue, 24 May 2016 00:28:30 +0200 Subject: [PATCH] fix fields.W342 warning ForeignKey(unique=True) -> OneToOneField --- bda/models.py | 2 +- bda2/models.py | 2 +- bda3/models.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bda/models.py b/bda/models.py index 5ef4f9bf..11c9dd3b 100644 --- a/bda/models.py +++ b/bda/models.py @@ -48,7 +48,7 @@ PAYMENT_TYPES = ( ) class Participant (models.Model): - user = models.ForeignKey(User, unique = True) + user = models.OneToOneField(User) choices = models.ManyToManyField(Spectacle, through = "ChoixSpectacle", related_name = "chosen_by") attributions = models.ManyToManyField(Spectacle, through = "Attribution", related_name = "attributed_to") paid = models.BooleanField (u"A payé", default = False) diff --git a/bda2/models.py b/bda2/models.py index bcc4e15c..c9fefe6e 100644 --- a/bda2/models.py +++ b/bda2/models.py @@ -48,7 +48,7 @@ PAYMENT_TYPES = ( ) class Participant (models.Model): - user = models.ForeignKey(User, unique = True, related_name = "participants2") + user = models.OneToOneField(User, related_name = "participants2") choices = models.ManyToManyField(Spectacle, through = "ChoixSpectacle", related_name = "chosen_by") attributions = models.ManyToManyField(Spectacle, through = "Attribution", related_name = "attributed_to") paid = models.BooleanField (u"A payé", default = False) diff --git a/bda3/models.py b/bda3/models.py index 80153233..6ada1be3 100644 --- a/bda3/models.py +++ b/bda3/models.py @@ -48,7 +48,7 @@ PAYMENT_TYPES = ( ) class Participant (models.Model): - user = models.ForeignKey(User, unique = True, related_name = "participants3") + user = models.OneToOneField(User, related_name = "participants3") choices = models.ManyToManyField(Spectacle, through = "ChoixSpectacle", related_name = "chosen_by") attributions = models.ManyToManyField(Spectacle, through = "Attribution", related_name = "attributed_to") paid = models.BooleanField (u"A payé", default = False)