2021-01-20 17:28:37 +01:00
|
|
|
import tortoise
|
|
|
|
from tortoise import fields
|
|
|
|
|
|
|
|
|
|
|
|
class Suggest(tortoise.Model):
|
|
|
|
suggest_id = fields.BigIntField(pk=True)
|
|
|
|
poll = fields.ForeignKeyField("models.Poll")
|
2021-01-22 10:22:39 +01:00
|
|
|
channel_id = fields.BigIntField()
|
|
|
|
message_id = fields.BigIntField()
|
|
|
|
author_id = fields.BigIntField()
|
2021-01-20 17:28:37 +01:00
|
|
|
|
|
|
|
proposition = fields.CharField(max_length=30)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
table = "suggests"
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return (
|
|
|
|
f"<suggest_id poll={self.poll} "
|
2021-01-22 10:22:39 +01:00
|
|
|
f"author_id={self.author_id} "
|
2021-01-20 17:28:37 +01:00
|
|
|
f"proposition={self.proposition}>"
|
|
|
|
)
|
|
|
|
|
|
|
|
__repr__ = __str__
|