Example #1
0
 def checksite():
     if R.exists(POSTINCR):
         print "Redis up and ready to go. \
                 Site implemented with incr: %i" % R.get(POSTINCR)
         return True
     else:
         R.incr(POSTINCR)
         print "Initialized to: %i" % R.get(POSTINCR)
         return True
Example #2
0
 def __init__(self, kind=None):
     self.pid = R.incr(POSTINCR)
     self.creation = datetime.datetime.now()
     self.published = False
     self.rank = 1
     if not isinstance(kind, str):
         self.kind = "_document" # abstract for <kind>:<pid>:<attribute>
     else:
         self.kind = kind