Esempio n. 1
0
    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
Esempio n. 2
0
    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
Esempio n. 3
0
 def delete(self):
     r.srem(_k(self.__class__.__name__.lower()), self.hash)
     r.delete(self.__get_key())
Esempio n. 4
0
 def delete(self):
     r.srem(_k(self.__class__.__name__.lower()), self.hash)
     r.delete(self.__get_key())