tuxbot-bot/utils/models/poll.py
Romain J be1e6d24e4 breaking change !
update(database): change database ORM

todo: update Admin, Poll and User cogs
2020-01-15 22:56:54 +01:00

29 lines
654 B
Python

import orm
from . import database, metadata
class ResponsesModel(orm.Model):
__tablename__ = 'responses'
__database__ = database
__metadata__ = metadata
id = orm.Integer(primary_key=True)
user = orm.String(max_length=18)
choice = orm.Integer()
class PollModel(orm.Model):
__tablename__ = 'polls'
__database__ = database
__metadata__ = metadata
id = orm.Integer(primary_key=True)
channel_id = orm.String(max_length=18)
message_id = orm.String(max_length=18)
content = orm.JSON()
is_anonymous = orm.Boolean()
available_choices = orm.Integer()
choice = orm.ForeignKey(ResponsesModel)