Exemplo n.º 1
0
 def __init__(
     self,
     user_item,
     clients,
     dynamo=None,
     album_manager=None,
     block_manager=None,
     chat_manager=None,
     comment_manager=None,
     follower_manager=None,
     like_manager=None,
     post_manager=None,
     user_manager=None,
     email_dynamo=None,
     phone_number_dynamo=None,
     placeholder_photos_directory=S3_PLACEHOLDER_PHOTOS_DIRECTORY,
     frontend_resources_domain=CLOUDFRONT_FRONTEND_RESOURCES_DOMAIN,
     **kwargs,
 ):
     super().__init__(**kwargs)
     self.clients = clients
     for client_name in self.client_names:
         if client_name in clients:
             setattr(self, f'{client_name}_client', clients[client_name])
     if dynamo:
         self.dynamo = dynamo
     if album_manager:
         self.album_manager = album_manager
     if block_manager:
         self.block_manager = block_manager
     if chat_manager:
         self.chat_manager = chat_manager
     if comment_manager:
         self.comment_manager = comment_manager
     if follower_manager:
         self.follower_manager = follower_manager
     if like_manager:
         self.like_manager = like_manager
     if post_manager:
         self.post_manager = post_manager
     if user_manager:
         self.user_manager = user_manager
     if email_dynamo:
         self.email_dynamo = email_dynamo
     if phone_number_dynamo:
         self.phone_number_dynamo = phone_number_dynamo
     self.item = user_item
     self.id = user_item['userId']
     self.placeholder_photos_directory = placeholder_photos_directory
     self.frontend_resources_domain = frontend_resources_domain
     self.real_dating_client = RealDatingClient()
     self.redeem_promotion_client = RedeemPromotionClient()
Exemplo n.º 2
0
    def __init__(self, clients, managers=None):
        super().__init__(clients, managers=managers)
        managers = managers or {}
        managers['chat'] = self
        self.block_manager = managers.get('block') or models.BlockManager(
            clients, managers=managers)
        self.chat_message_manager = managers.get(
            'chat_message') or models.ChatMessageManager(clients,
                                                         managers=managers)
        self.user_manager = managers.get('user') or models.UserManager(
            clients, managers=managers)

        self.clients = clients
        self.real_dating_client = RealDatingClient()
        if 'dynamo' in clients:
            self.dynamo = ChatDynamo(clients['dynamo'])
            self.member_dynamo = ChatMemberDynamo(clients['dynamo'])
Exemplo n.º 3
0
    def __init__(self, clients, managers=None):
        super().__init__(clients, managers=managers)
        managers = managers or {}
        managers['comment'] = self
        self.block_manager = managers.get('block') or models.BlockManager(
            clients, managers=managers)
        self.follower_manager = managers.get(
            'follower') or models.FollowerManager(clients, managers=managers)
        self.post_manager = managers.get('post') or models.PostManager(
            clients, managers=managers)
        self.user_manager = managers.get('user') or models.UserManager(
            clients, managers=managers)

        self.real_dating_client = RealDatingClient()
        # self.bad_words_client = BadWordsClient()
        if 'dynamo' in clients:
            self.dynamo = CommentDynamo(clients['dynamo'])