def is_expired(self):
    now = datetime.now().date()
    extra = ""
    image = 'img/admin/icon_success.gif'
    days_left = (self.exp_date - now).days
    if self.status == 1: image = 'img/admin/icon_changelink.gif'
    elif self.status in (2,3):
        if days_left <= 0:
            image = 'img/admin/icon_error.gif'
            extra = _(' <strong>(%s days late.)</strong>' % (days_left * -1))
        else:
            image = 'img/admin/icon_clock.gif'
            extra = _(" (%s days left.)" % days_left)
    return '<img src="%(admin_media)s%(image)s" />%(extra)s' % {'admin_media': settings.ADMIN_MEDIA_PREFIX,
                                                               'image': image,
                                                               'extra': extra,}
Check if an invoice is expired
dataset/ETHPy150Open bread-and-pepper/django-brookie/brookie/admin.py/is_expired