def create_conversation(self): """ Create a new conversation. """ Conversation = self.get_model('conversation') session = self.Session() conversation = Conversation() session.add(conversation) session.flush() session.refresh(conversation) conversation_id = conversation.id session.commit() session.close() return conversation_id
def create_conversation(self): """ Create a new conversation. """ from chatterbot.ext.sqlalchemy_app.models import Conversation session = self.Session() conversation = Conversation() session.add(conversation) session.flush() session.refresh(conversation) conversation_id = conversation.id session.commit() session.close() return conversation_id