This commit is contained in:
+5
-10
@@ -8,12 +8,7 @@ from nextcord.ext import commands
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from database_setup.sql_data_classes import (
|
||||
ParticipationPoints,
|
||||
Presences,
|
||||
Votes,
|
||||
engine,
|
||||
)
|
||||
from database_setup.sql_data_classes import EventPoints, Presences, Votes, engine
|
||||
from utils import VoteType
|
||||
|
||||
|
||||
@@ -48,14 +43,14 @@ class ViewCog(commands.Cog, name="View Commands"):
|
||||
with Session(engine) as session:
|
||||
if quarter_name:
|
||||
df = pd.read_sql_query(
|
||||
sql=session.query(ParticipationPoints)
|
||||
.where(ParticipationPoints.Cycle.startswith(quarter_name))
|
||||
sql=session.query(EventPoints)
|
||||
.where(EventPoints.Cycle.startswith(quarter_name))
|
||||
.statement,
|
||||
con=engine,
|
||||
)
|
||||
else:
|
||||
df = pd.read_sql_query(
|
||||
sql=session.query(ParticipationPoints).statement,
|
||||
sql=session.query(EventPoints).statement,
|
||||
con=engine,
|
||||
)
|
||||
|
||||
@@ -231,7 +226,7 @@ class ViewCog(commands.Cog, name="View Commands"):
|
||||
"""
|
||||
|
||||
with Session(engine) as session:
|
||||
stmt = select(ParticipationPoints.Cycle).distinct()
|
||||
stmt = select(EventPoints.Cycle).distinct()
|
||||
quarters = session.scalars(stmt)
|
||||
|
||||
# if empty compare string
|
||||
|
||||
Reference in New Issue
Block a user