def __call__(self, **kwargs): modified = ILastUpdated(self.context)() etag = self.context.__name__ if isinstance(modified, datetime): etag += modified.isoformat().split('.')[0] if kwargs: etag += '%s' % kwargs return encodestring(etag)
def lastmodified(self, page): date = ILastUpdated(page)() if not isinstance(date, datetime): return '' date = date.isoformat() # tz info if '+' not in date: date = date + '+00:00' return date