1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
Administrator-py/db/Task.py

20 lines
647 B
Python
Raw Normal View History

2020-05-27 23:19:51 +02:00
from db import Base
from sqlalchemy import Column, Integer, String, BigInteger, DateTime
2020-05-27 23:19:51 +02:00
from datetime import datetime
class Task(Base):
__tablename__ = "tasks"
id = Column(Integer, primary_key=True)
message = Column(String, nullable=False)
user = Column(BigInteger, nullable=False)
channel = Column(BigInteger, nullable=False)
date = Column(DateTime, nullable=False)
creation_date = Column(DateTime, default=datetime.now())
2020-05-27 23:19:51 +02:00
def __init__(self, message: str, user: int, channel: int, date: datetime):
self.message = message
self.user = user
self.channel = channel
self.date = date