Commit 5becf1ec authored by Nicolas Joyard's avatar Nicolas Joyard

Remove hashable_fields

parent f43ee25c
......@@ -49,8 +49,6 @@ class Representative(TimeStampedModel):
photo = models.CharField(max_length=512, null=True)
active = models.BooleanField(default=False)
hashable_fields = ['remote_id']
def __unicode__(self):
return smart_unicode(self.full_name)
......@@ -109,8 +107,6 @@ class Chamber(models.Model):
abbreviation = models.CharField(max_length=10, blank=True, default='',
db_index=True)
hashable_fields = ['name', 'country', 'abbreviation']
def __unicode__(self):
return u'{} [{}]'.format(self.name, self.abbreviation)
......@@ -125,8 +121,6 @@ class Group(TimeStampedModel):
kind = models.CharField(max_length=255, db_index=True)
chamber = models.ForeignKey(Chamber, null=True, related_name='groups')
hashable_fields = ['name', 'abbreviation', 'kind', 'chamber']
@cached_property
def active(self):
return self.mandates.filter(end_date__gte=datetime.now()).exists()
......@@ -146,8 +140,6 @@ class Constituency(TimeStampedModel):
country = models.ForeignKey('Country', null=True, blank=True,
related_name='constituencies')
hashable_fields = ['name', 'country']
@cached_property
def active(self):
return self.mandates.filter(end_date__gte=datetime.now()).exists()
......@@ -184,9 +176,6 @@ class Mandate(TimeStampedModel):
end_date = models.DateField(blank=True, null=True)
link = models.URLField()
hashable_fields = ['group', 'constituency', 'role', 'begin_date',
'end_date', 'representative']
@property
def active(self):
return self.end_date >= datetime.now().date()
......
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