@@ -158,7 +158,11 @@ class Demeter(object):
for i in xrange(length):
salt += chars[rand(0, len_chars)]
return salt
-
+ @staticmethod
+ def hour(value):
+ if value < 10:
+ return '0' + str(value)
+ return value
@staticmethod
def time():
return int(time.time())
@@ -39,11 +39,11 @@ class Service(object):
return data
# 更新
- def update(self, name, id, data):
+ def update(self, name, id, data, cdate=True):
model = self.model(name)
if id:
model.id = id
- if 'cdate' not in data:
+ if cdate == True and 'cdate' not in data:
data['cdate'] = 'time'
model.update(data)
return id