def urlinfo(self): l = request.form['list'] items = l.split(",") if "," in l else [l] result = {} for item in items: key = _k("url.%s" % item) h = r.get(key) if h: f = File.from_hash(h) if f: result[item] = _file_object(f) else: result[item] = None r.delete(key) else: result[item] = None return result
def delete(self): r.srem(_k(self.__class__.__name__.lower()), self.hash) r.delete(self.__get_key())