示例#1
0
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     if self[self.primarykey] is None or \
             len(str(self[self.primarykey])) < 2:
         self[self.primarykey] = '%s_%s' % (
             self.label, self.getHashValue(str(self.BaseAttributes)))
     pass
示例#2
0
 def __init__(self, name=None, code=None, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     if name is not None:
         self['NAME'] = name
     if code is not None:
         self['CODE'] = code
     pass
示例#3
0
 def __init__(self, address='', **kwargs):
     BaseEntity.__init__(self, **kwargs)
     address = str(address).replace(' ', '')
     if len(address) > 1:
         self['ADDRESS'] = address
     # self.__split_levels__()
     pass
示例#4
0
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     # if self[self.primarykey] is None:
     #     self[self.primarykey] = '%s_%s' % (
     #         self.label,
     #         self.getHashValue(str(self.BaseAttributes))
     #     )
     pass
示例#5
0
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     # self['HASH_ID'] = hash(str(self.BaseAttributes))
     self[self.primarykey] = '%s_%s' % (
         self.label, self.getHashValue(str(self.BaseAttributes)))
     # if 'URL' in self.BaseAttributes.keys():
     #     self['URL'] = self.parser_url(
     #         self['URL'])
     pass
示例#6
0
文件: product.py 项目: CharsLeung/zlr
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     if self[self.primarykey] is None:
         if self['NAME'] is not None and \
                 len(str(self['NAME'])) > 1:
             self[self.primarykey] = '%s_%s' % (
                 self.label,
                 self.getHashValue(self['NAME'])
             )
     pass
示例#7
0
文件: bidding.py 项目: CharsLeung/zlr
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     # self['HASH_ID'] = hash(str(self.BaseAttributes))
     # if 'URL' in self.BaseAttributes.keys():
     #     self['URL'] = self.format_url(self['URL'])
     if self['URL'] is None:
         self['URL'] = '%s_%s' % (
             self.label,
             self.getHashValue(str(self.BaseAttributes))
         )
     pass
示例#8
0
文件: holder.py 项目: CharsLeung/zlr
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     if 'URL' in self.BaseAttributes.keys():
         self['URL'] = self.parser_url(self['URL'])
         if self['URL'] is None:
             if len(self['NAME']) < 2:
                 self['NAME'] = None
             else:
                 self['URL'] = '%s_%s' % (self.label,
                                          self.getHashValue(self['NAME']))
     pass
示例#9
0
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     if 'CASE_IDENTITY' in self.BaseAttributes.keys():
         self.CASE_IDENTITY = self.BaseAttributes.pop('CASE_IDENTITY')
     else:
         self.CASE_IDENTITY = None
     if self[self.primarykey] is None or \
             len(str(self[self.primarykey])) < 2:
         self[self.primarykey] = '%s_%s' % (
             self.label, self.getHashValue(str(self.BaseAttributes)))
     pass
示例#10
0
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     # self['HASH_ID'] = hash(str(self.BaseAttributes))
     if 'URL' in self.BaseAttributes.keys():
         self['URL'] = self.parser_url(self['URL'])
         if self['URL'] is None:
             if len(self['NAME']) < 2:
                 self['NAME'] = None
             else:
                 self['URL'] = 'Possession_%s' % self.getHashValue(
                     self['NAME'])
     pass
示例#11
0
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     if 'URL' in self.BaseAttributes.keys():
         self['URL'] = self.parser_url(
             self['URL'])
     if self[self.primarykey] is None or \
             len(self[self.primarykey]) < 2:
         self[self.primarykey] = '%s_%s' % (
             self.label,
             self.getHashValue(str(self.BaseAttributes))
         )
     pass
示例#12
0
    def __init__(self, **kwargs):
        BaseEntity.__init__(self)
        if len(kwargs):
            sks = self.synonyms.keys()
            cad = self.chineseAttributeDict()
            for k, v in zip(kwargs.keys(), kwargs.values()):
                if k in cad.keys():
                    self[cad[k]] = v
                elif k in sks:
                    self[cad[self.synonyms[k]]] = v
                else:
                    warnings.warn('Undefined key for dict of applets.')
                    self[k] = v

        pass
示例#13
0
文件: person.py 项目: CharsLeung/zlr
 def __init__(self,
              NAME=None,
              SEX=None,
              EDUCATION=None,
              URL=None,
              **kwargs):
     BaseEntity.__init__(self, **kwargs)
     if NAME is not None:
         self[self.get_englishAttribute_by_chinese('姓名')] = NAME
     if SEX is not None:
         self[self.get_englishAttribute_by_chinese('性别')] = SEX
     if EDUCATION is not None:
         self[self.get_englishAttribute_by_chinese('学历')] = EDUCATION
     if URL is not None:
         self[self.get_englishAttribute_by_chinese('链接')] = URL
     if 'URL' in self.BaseAttributes.keys():
         self['URL'] = self.parser_url(self['URL'])
     pass
示例#14
0
文件: check.py 项目: CharsLeung/zlr
 def __init__(self, **kwargs):
     BaseEntity.__init__(self)
     if len(kwargs):
         sks = self.synonyms.keys()
         cad = self.chineseAttributeDict()
         for k, v in zip(kwargs.keys(), kwargs.values()):
             if k in cad.keys():
                 self[cad[k]] = v
             elif k in sks:
                 self[cad[self.synonyms[k]]] = v
             else:
                 warnings.warn('Undefined key for dict of random-check.')
                 self[k] = v
     # self['HASH_ID'] = hash(str(self.BaseAttributes))
     # if 'URL' in self.BaseAttributes.keys():
     #     self['URL'] = self.parser_url(
     #         self['URL'])
     pass
示例#15
0
 def __init__(self, **kwargs):
     BaseEntity.__init__(self)
     if len(kwargs):
         sks = self.synonyms.keys()
         cad = self.chineseAttributeDict()
         for k, v in zip(kwargs.keys(), kwargs.values()):
             if k in cad.keys():
                 self[cad[k]] = v
             elif k in sks:
                 self[cad[self.synonyms[k]]] = v
             else:
                 # warnings.warn('Undefined key for dict of ruling text.')
                 self[k] = v
     # if 'URL' in self.BaseAttributes.keys():
     #     self['URL'] = self.parser_url(
     #         self['URL'])
     if self[self.primarykey] is None or \
             len(str(self[self.primarykey])) < 2:
         self[self.primarykey] = '%s_%s' % (
             self.label, self.getHashValue(str(self.BaseAttributes)))
     pass
示例#16
0
文件: news.py 项目: CharsLeung/zlr
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     # self['HASH_ID'] = hash(str(self.BaseAttributes))
     if 'URL' in self.BaseAttributes.keys():
         self['URL'] = self.format_url(self['URL'])
     pass
示例#17
0
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     # self['HASH_ID'] = hash(str(self.BaseAttributes))
     self[self.primarykey] = '%s_%s' % (
         self.label, self.getHashValue(str(self.BaseAttributes)))
     pass
示例#18
0
 def __init__(self, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     pass
示例#19
0
文件: mail.py 项目: CharsLeung/zlr
 def __init__(self, email=None, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     if email is not None and len(email) > 1:
         self['EMAIL'] = email
     self.__split_levels__()
     pass
示例#20
0
 def __init__(self, telephone=None, **kwargs):
     BaseEntity.__init__(self, **kwargs)
     if telephone is not None and len(str(telephone)) > 1:
         self['TELEPHONE'] = telephone
     pass