def save(self, *args, **kwargs): if not self.createtime: self.createtime = UtilTime().timestamp if not self.passwd: self.passwd = md5pass('123456') if not self.pay_passwd: self.pay_passwd = md5pass('123456') return super(Users, self).save(*args, **kwargs)
def sign(self, signValue): s = md5pass(json.dumps(signValue) + self.key) a = base64.b64encode(s.encode('utf-8')) return parse.quote(a)