tuxbot-bot/utils/models/warn.py

20 lines
569 B
Python
Raw Normal View History

import datetime
2019-12-16 18:12:10 +01:00
from . import Base
from sqlalchemy import Column, Integer, String, BIGINT, TIMESTAMP
2019-12-30 00:48:11 +01:00
class WarnModel(Base):
__tablename__ = 'warns'
id = Column(Integer, primary_key=True)
server_id = Column(BIGINT)
user_id = Column(BIGINT)
reason = Column(String)
created_at = Column(TIMESTAMP, default=datetime.datetime.now())
def __repr__(self):
2019-12-30 00:48:11 +01:00
return "<WarnModel(server_id='%s', user_id='%s', reason='%s', " \
"created_at='%s')>" \
% (self.server_id, self.user_id, self.reason, self.created_at)