示例#1
0
文件: user.py 项目: trevor/mailman3
 def __init__(self, store, display_name=None, preferences=None):
     super(User, self).__init__()
     self._created_on = date_factory.now()
     user_id = uid_factory.new_uid()
     assert store.find(User, _user_id=user_id).count() == 0, (
         'Duplicate user id {0}'.format(user_id))
     self._user_id = user_id
     self.display_name = ('' if display_name is None else display_name)
     self.preferences = preferences
     store.add(self)
示例#2
0
文件: user.py 项目: aswinpj/Mailman
 def __init__(self, store, display_name=None, preferences=None):
     super().__init__()
     self._created_on = date_factory.now()
     user_id = uid_factory.new()
     assert store.query(User).filter_by(_user_id=user_id).count() == 0, (
         'Duplicate user id {}'.format(user_id))
     self._user_id = user_id
     self.display_name = ('' if display_name is None else display_name)
     if preferences is not None:
         store.add(preferences)
         self.preferences = preferences
     store.add(self)
示例#3
0
文件: user.py 项目: inonit/mailman
 def __init__(self, store, display_name=None, preferences=None):
     super().__init__()
     self._created_on = date_factory.now()
     user_id = uid_factory.new()
     assert store.query(User).filter_by(_user_id=user_id).count() == 0, (
         'Duplicate user id {}'.format(user_id))
     self._user_id = user_id
     self.display_name = ('' if display_name is None else display_name)
     if preferences is not None:
         store.add(preferences)
         self.preferences = preferences
     store.add(self)