Ejemplo n.º 1
0
 def create(self):
     c_ = self.get(status=1)
     if c_:
         return c_
     self.status = 1
     self.gmt_modified = self.gmt_created = datetime.now()
     self.nid = get_key()
     return self.save()
Ejemplo n.º 2
0
 def create(self):
     # 域名集群唯一
     if self.get(status=1, name=self.name, cluster=self.cluster):
         logger.error('该集群上站点域名记录已经存在')
         raise Exception('该集群上站点域名记录已经存在')
     self.gmt_modified = self.gmt_created = datetime.now()
     self.nid = get_key()
     self.token = get_key()
     self.status = 1
     self.web_status = 1
     self.defend_web = -1
     self.defend_cc = 1
     self.defend_blacklist = 1
     self.defend_custom = -1
     self.defend_cc_policy1 = 1000000
     self.defend_cc_policy2 = 5
     self.conf_type = 'professional'  # 默认显示标准配置
     return self.save()
Ejemplo n.º 3
0
 def create(self):
     self.f_rule_status = 1
     self.gmt_modified = self.gmt_created = datetime.now()
     self.nid = get_key()
     self.status = 1
     return self.save()
Ejemplo n.º 4
0
 def create(self):
     self.gmt_modified = self.gmt_created = datetime.now()
     self.nid = get_key()
     self.remake = get_hash(self.file_data)
     self.status = 1
     return self.save()