Exemplo n.º 1
0
    def insert(self, data, date=None):
        key = str(uuid.uuid1())

        self.client.set(key, self.serialize(data))

        serialized_key = self.serialize((coerce_ts(date), key))

        # Insert into the global index
        self.client.push('_all', serialized_key, head=True)

        # Maintain the other indices
        for idx_key in self.indexes_from_data(data):
            self.client.push(idx_key, serialized_key, head=True)
Exemplo n.º 2
0
 def insert(self, data, date=None):
     key = str(uuid.uuid1())
     
     self.client.set(key, self.serialize(data))
     
     serialized_key = self.serialize((coerce_ts(date), key))
     
     # Insert into the global index
     self.client.push('_all', serialized_key, head=True)
     
     # Maintain the other indices
     for idx_key in self.indexes_from_data(data):
         self.client.push(idx_key, serialized_key, head=True)
Exemplo n.º 3
0
    def insert(self, data, date=None):
        key = str(uuid.uuid1())

        self._items[key] = self.serialize(data)

        t = coerce_ts(date)

        # Insert into the global index
        self._indices['_all'].insert(0, (t, key))

        # Maintain the other indices
        for idx_key in self.indexes_from_data(data):
            self._indices[idx_key].insert(0, (t, key))

        return key
Exemplo n.º 4
0
 def insert(self, data, date=None):
     key = str(uuid.uuid1())
     
     self._items[key] = self.serialize(data)
     
     t = coerce_ts(date)
     
     # Insert into the global index
     self._indices['_all'].insert(0, (t, key))
     
     # Maintain the other indices
     for idx_key in self.indexes_from_data(data):
         self._indices[idx_key].insert(0, (t, key))
     
     return key