Update view event points for new table name.
This commit is contained in:
@@ -7,7 +7,7 @@ from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from database_setup.sql_data_classes import (
|
||||
EventPoints,
|
||||
Points,
|
||||
Presences,
|
||||
Votes,
|
||||
engine,
|
||||
@@ -49,12 +49,12 @@ class ViewCog(commands.Cog, name="View Commands"):
|
||||
with Session(engine) as session:
|
||||
if quarter_name:
|
||||
ppdf = pd.read_sql_query(
|
||||
sql=session.query(EventPoints).where(EventPoints.QuarterName.startswith(quarter_name)).statement,
|
||||
sql=session.query(Points).where(Points.QuarterName.startswith(quarter_name)).statement,
|
||||
con=engine,
|
||||
)
|
||||
else:
|
||||
ppdf = pd.read_sql_query(
|
||||
sql=session.query(EventPoints).statement,
|
||||
sql=session.query(Points).statement,
|
||||
con=engine,
|
||||
)
|
||||
|
||||
@@ -83,7 +83,7 @@ class ViewCog(commands.Cog, name="View Commands"):
|
||||
sorted_all = pd.concat([sorted_members, sorted_non_members], ignore_index=True, sort=False)
|
||||
for row in sorted_all.itertuples():
|
||||
userid = row.UserId
|
||||
points = row.Points
|
||||
points = row.EventPoints
|
||||
discord_member = row.DiscordMember
|
||||
content += f"<@{userid}>: {points}\n" if discord_member else f"{userid}: {points}\n"
|
||||
content += "\n"
|
||||
@@ -201,7 +201,7 @@ class ViewCog(commands.Cog, name="View Commands"):
|
||||
quarter_name (str): String to run autocomplete on.
|
||||
"""
|
||||
with Session(engine) as session:
|
||||
stmt = select(EventPoints.QuarterName).distinct()
|
||||
stmt = select(Points.QuarterName).distinct()
|
||||
quarters = session.scalars(stmt)
|
||||
|
||||
# if empty compare string
|
||||
|
||||
Reference in New Issue
Block a user