2020-11-08 01:07:27 +01:00
|
|
|
import tortoise
|
|
|
|
from tortoise import fields
|
|
|
|
|
|
|
|
|
2020-11-12 00:03:01 +01:00
|
|
|
class Warn(tortoise.Model):
|
2020-11-08 01:07:27 +01:00
|
|
|
id = fields.BigIntField(pk=True)
|
|
|
|
server_id = fields.BigIntField()
|
|
|
|
user_id = fields.BigIntField()
|
|
|
|
reason = fields.TextField(max_length=255)
|
|
|
|
created_at = fields.DatetimeField()
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
table = "warns"
|
|
|
|
|
|
|
|
def __str__(self):
|
2020-11-09 01:18:55 +01:00
|
|
|
return (
|
2020-11-12 00:03:01 +01:00
|
|
|
f"<Warn id={self.id} "
|
2020-11-09 01:18:55 +01:00
|
|
|
f"server_id={self.server_id} "
|
|
|
|
f"user_id={self.user_id} "
|
|
|
|
f"reason='{self.reason}' "
|
|
|
|
f"created_at={self.created_at}>"
|
|
|
|
)
|
2020-11-08 01:07:27 +01:00
|
|
|
|
|
|
|
__repr__ = __str__
|