You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
799 B
25 lines
799 B
from datetime import datetime
|
|
from sqlalchemy import Column, String, Integer, Boolean, Time, PrimaryKeyConstraint
|
|
from sqlalchemy.orm import declarative_base
|
|
|
|
Base = declarative_base()
|
|
class Raid(Base):
|
|
__tablename__ = "raid"
|
|
|
|
name = Column(String(30))
|
|
number = Column(Integer)
|
|
location = Column(String(50))
|
|
level = Column(Integer)
|
|
start_time = Column(Time)
|
|
end_time = Column(Time)
|
|
country = Column(String(2))
|
|
PrimaryKeyConstraint(name, location, start_time, end_time, name="raid_pk")
|
|
|
|
def is_dispawned(self):
|
|
if datetime().now() > self.end_time:
|
|
return True
|
|
return False
|
|
|
|
def __repr__(self):
|
|
return f"(Raid: {self.name} - {self.level}-star - {self.location} - Start: {self.start_time} - End: {self.end_time})"
|
|
|