Skip to content
Extraits de code Groupes Projets
Valider 8c6104e8 rédigé par Yohan Boniface's avatar Yohan Boniface
Parcourir les fichiers

[mod] Do not make Representative an abstract model for now

It's not possible to have a ForeignKey pointing on an abstract model,
so we have two options to keep Representative: keep in asbtract, and make
mandatory to define one and just one class that inherit from it ; have it
non abstract, and so having the possibilty to create serveral classes that
inherit from Representative, but so it means that all requests will have a
JOIN between the two tables
parent 4eac4090
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -31,12 +31,9 @@ class Representative(models.Model):
birth_date = models.DateField(blank=True, null=True)
cv = models.TextField(blank=True, null=True)
class Meta:
abstract = True
class Contact(models.Model):
representative = models.ForeignKey("Representative")
representative = models.ForeignKey(Representative)
class Meta:
abstract = True
......@@ -92,4 +89,4 @@ class Mandate(models.Model):
# Sometimes begin_date and end_date are not available
active = models.NullBooleanField(default=False)
representative = models.ForeignKey("Representative")
representative = models.ForeignKey(Representative)
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter