Пример #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
 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
 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
 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
 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
 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
 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
 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