2020-01-15 22:56:54 +01:00
|
|
|
import orm
|
|
|
|
from . import database, metadata
|
2019-10-06 01:49:30 +02:00
|
|
|
|
|
|
|
|
2020-01-15 22:56:54 +01:00
|
|
|
class ResponsesModel(orm.Model):
|
|
|
|
__tablename__ = 'responses'
|
|
|
|
__database__ = database
|
|
|
|
__metadata__ = metadata
|
2019-10-06 01:49:30 +02:00
|
|
|
|
2020-01-15 22:56:54 +01:00
|
|
|
id = orm.Integer(primary_key=True)
|
|
|
|
user = orm.String(max_length=18)
|
2019-10-09 00:14:43 +02:00
|
|
|
|
2020-01-15 22:56:54 +01:00
|
|
|
choice = orm.Integer()
|
2019-10-09 00:14:43 +02:00
|
|
|
|
|
|
|
|
2020-01-15 22:56:54 +01:00
|
|
|
class PollModel(orm.Model):
|
|
|
|
__tablename__ = 'polls'
|
|
|
|
__database__ = database
|
|
|
|
__metadata__ = metadata
|
2019-10-09 00:14:43 +02:00
|
|
|
|
2020-01-15 22:56:54 +01:00
|
|
|
id = orm.Integer(primary_key=True)
|
|
|
|
channel_id = orm.String(max_length=18)
|
|
|
|
message_id = orm.String(max_length=18)
|
2019-10-09 00:14:43 +02:00
|
|
|
|
2020-01-15 22:56:54 +01:00
|
|
|
content = orm.JSON()
|
|
|
|
is_anonymous = orm.Boolean()
|
2019-10-09 00:14:43 +02:00
|
|
|
|
2020-01-15 22:56:54 +01:00
|
|
|
available_choices = orm.Integer()
|
|
|
|
choice = orm.ForeignKey(ResponsesModel)
|