|
@ -26,17 +26,10 @@ class Legislatura(models.Model): |
|
|
|
|
|
|
|
|
def atual(self): |
|
|
def atual(self): |
|
|
current_year = datetime.now().year |
|
|
current_year = datetime.now().year |
|
|
if(self.data_inicio.year <= current_year and |
|
|
return self.data_inicio.year <= current_year <= self.data_fim.year |
|
|
self.data_fim.year >= current_year): |
|
|
|
|
|
return True |
|
|
|
|
|
else: |
|
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
def __str__(self): |
|
|
if self.atual(): |
|
|
current = ' (%s)' % _('Atual') if self.atual() else '' |
|
|
current = ' (%s)' % _('Atual') |
|
|
|
|
|
else: |
|
|
|
|
|
current = '' |
|
|
|
|
|
|
|
|
|
|
|
return _('%(numero)sª (%(start)s - %(end)s)%(current)s') % { |
|
|
return _('%(numero)sª (%(start)s - %(end)s)%(current)s') % { |
|
|
'numero': self.numero, |
|
|
'numero': self.numero, |
|
|