This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/data/model/message.py
2016-10-11 09:30:37 -04:00

13 lines
369 B
Python

from data.database import Messages
def get_messages():
"""Query the data base for messages and returns a container of database message objects"""
return Messages.select()
def create(messages):
"""Insert messages into the database."""
inserted = []
for message in messages:
inserted.append(Messages.create(content=message['content']))
return inserted