apps/chat/models.py
def create_long_polling(self, user_token):
        """
        Create new long polling process and terminate all older one
        :param user_token: String
        :return: String|False process identifier, false if failed
        """
        try:
            # delete all processes
            self.delete_long_polling(user_token)

            long_polling = LongPolling(_id=ObjectId(), user_token=user_token,
                                       created=datetime.datetime.now())
            self.update(push__long_polling=long_polling)
        except (TypeError, InvalidId, DoesNotExist) as ex:
            # @TODO logging this error
            return False

        return str(long_polling._id)

        Create new long polling process and terminate all older one
        :param user_token: String
        :return: String|False process identifier, false if failed
        
Create new long polling process and terminate all older one
Create new long polling process and terminate all older one
def create_long_polling(self, user_token):
        try:
            self.delete_long_polling(user_token)
            long_polling = LongPolling(_id=ObjectId(), user_token=user_token,
                                       created=datetime.datetime.now())
            self.update(push__long_polling=long_polling)
        except (TypeError, InvalidId, DoesNotExist) as ex:
            return False
        return str(long_polling._id)
def create_long_polling ( self , user_token ) : try : self . delete_long_polling ( user_token ) long_polling = LongPolling ( _id = ObjectId ( ) , user_token = user_token , created = datetime . datetime . now ( ) ) self . update ( push__long_polling = long_polling ) except ( TypeError , InvalidId , DoesNotExist ) as ex : return False return str ( long_polling . _id )
Create new long polling process and terminate all older one
Create new long polling process and terminate all older one
"""
        Create new long polling process and terminate all older one
        :param user_token: String
        :return: String|False process identifier, false if failed
        """ # delete all processes # @TODO logging this error
String|False process identifier, false if failed
String|False process identifier false if failed
self
user_token
None