from data.database import Messages
def get_messages():
messages = []
for message in Messages.select():
messages.append({'id': message.id, 'content': message.content})
return messages
def create(messages):
for message in messages:
Messages.create(content=message['content'])