def _update_history_etag(self, href, item): logger.debug("_update_history_etag") try: item = DBItem.objects.get(name=href) except DBItem.DoesNotExist: return if not item.history_etag: history_etag = binascii.hexlify(os.urandom(16)).decode("ascii") item.history_etag = get_etag(history_etag + "/" + item.etag).strip("\"") item.save() return item.history_etag
def etag(self): """Encoded as quoted-string (see RFC 2616).""" return get_etag(self.item.serialize())
def etag(self): return get_etag(self.item.datas.decode('ascii'))