Commit 8c6104e8 authored by Yohan Boniface's avatar Yohan Boniface

[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
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment