Revision 7eadc230 snf-astakos-app/astakos/im/models.py
b/snf-astakos-app/astakos/im/models.py | ||
---|---|---|
1556 | 1556 |
def reactivating_projects(self): |
1557 | 1557 |
return self.filter(state=Project.APPROVED, is_active=False) |
1558 | 1558 |
|
1559 |
def expired_projects(self): |
|
1560 |
q = (~Q(state=Project.TERMINATED) & |
|
1561 |
Q(application__end_date__lt=datetime.now())) |
|
1562 |
return self.filter(q) |
|
1563 |
|
|
1564 |
|
|
1559 | 1565 |
class Project(models.Model): |
1560 | 1566 |
|
1561 | 1567 |
application = models.OneToOneField( |
... | ... | |
1608 | 1614 |
def state_display(self): |
1609 | 1615 |
return self.STATE_DISPLAY.get(self.state, _('Unknown')) |
1610 | 1616 |
|
1617 |
def expiration_info(self): |
|
1618 |
return (str(self.id), self.name, self.state_display(), |
|
1619 |
str(self.application.end_date)) |
|
1620 |
|
|
1611 | 1621 |
def is_deactivated(self, reason=None): |
1612 | 1622 |
if reason is not None: |
1613 | 1623 |
return self.state == reason |
Also available in: Unified diff