Volunteer Janitor: Record accepted tasks.
This commit is contained in:
parent
03b323c7a1
commit
0a8bbae290
6 changed files with 113 additions and 22 deletions
29
files/classes/volunteer_janitor.py
Normal file
29
files/classes/volunteer_janitor.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
|
||||
import enum
|
||||
from files.__main__ import Base
|
||||
from sqlalchemy import *
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
class VolunteerJanitorResult(enum.Enum):
|
||||
Pending = 0
|
||||
TopQuality = 1
|
||||
Good = 2
|
||||
Neutral = 3
|
||||
Bad = 4
|
||||
Warning = 5
|
||||
Ban = 6
|
||||
|
||||
class VolunteerJanitorRecord(Base):
|
||||
|
||||
__tablename__ = "volunteer_janitor"
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
|
||||
comment_id = Column(Integer, ForeignKey("comments.id"), nullable=False)
|
||||
edited_utc = Column(DateTime, default=0, nullable=False)
|
||||
result = Column(Enum(VolunteerJanitorResult), default=VolunteerJanitorResult.Pending, nullable=False)
|
||||
|
||||
Index('volunteer_comment_index', user_id, comment_id)
|
||||
|
||||
user = relationship("User")
|
||||
comment = relationship("Comment")
|
Loading…
Add table
Add a link
Reference in a new issue