Example #1
0
    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
Example #2
0
 def etag(self):
     """Encoded as quoted-string (see RFC 2616)."""
     return get_etag(self.item.serialize())
Example #3
0
 def etag(self):
     return get_etag(self.item.datas.decode('ascii'))