Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ dependencies = [
"weasyprint>=63.1",
"opencv-python-headless>=4.10.0.84",
"psycopg[c]==3.2.12",
"sentence-transformers>=3.0.0",
"scikit-learn>=1.5.0",
"bertopic>=0.16.0",
"nltk>=3.8.0",
]
name = "backend"
version = "0.1.0"
Expand Down
48 changes: 24 additions & 24 deletions backend/reviews/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,38 +42,38 @@ class ReviewAdapter(Protocol):
"""Protocol defining the interface for review type adapters."""

@property
def recap_template(self) -> str:
"""Template name for the recap view."""
def shortlist_template(self) -> str:
"""Template name for the shortlist view."""
...

@property
def review_template(self) -> str:
"""Template name for the individual review view."""
...

def get_recap_items_queryset(
def get_shortlist_items_queryset(
self,
review_session: ReviewSession,
) -> QuerySet:
"""Return annotated queryset of items for the recap view."""
"""Return annotated queryset of items for the shortlist view."""
...

def get_recap_context(
def get_shortlist_context(
self,
request: HttpRequest,
review_session: ReviewSession,
items: QuerySet,
admin_site: AdminSite,
) -> dict[str, Any]:
"""Return template context for the recap view."""
"""Return template context for the shortlist view."""
...

def process_recap_post(
def process_shortlist_post(
self,
request: HttpRequest,
review_session: ReviewSession,
) -> None:
"""Process and save decisions from the recap form."""
"""Process and save decisions from the shortlist form."""
...

def get_review_context(
Expand Down Expand Up @@ -111,18 +111,18 @@ class ProposalsReviewAdapter:
"""Adapter for handling Proposals (Submissions) reviews."""

@property
def recap_template(self) -> str:
return "proposals-recap.html"
def shortlist_template(self) -> str:
return "proposals-shortlist.html"

@property
def review_template(self) -> str:
return "proposal-review.html"

def get_recap_items_queryset(
def get_shortlist_items_queryset(
self,
review_session: ReviewSession,
) -> QuerySet[Submission]:
"""Return submissions annotated with scores for the recap view."""
"""Return submissions annotated with scores for the shortlist view."""
review_session_id = review_session.id

return (
Expand Down Expand Up @@ -159,14 +159,14 @@ def get_recap_items_queryset(
)
)

def get_recap_context(
def get_shortlist_context(
self,
request: HttpRequest,
review_session: ReviewSession,
items: QuerySet,
admin_site: AdminSite,
) -> dict[str, Any]:
"""Return template context for the proposals recap view."""
"""Return template context for the proposals shortlist view."""
conference = review_session.conference
speakers_ids = items.values_list("speaker_id", flat=True)

Expand Down Expand Up @@ -197,10 +197,10 @@ def get_recap_context(
submission_types=conference.submission_types.all(),
review_session_repr=str(review_session),
all_statuses=[choice for choice in Submission.STATUS],
title="Recap",
title="Shortlist",
)

def process_recap_post(
def process_shortlist_post(
self,
request: HttpRequest,
review_session: ReviewSession,
Expand Down Expand Up @@ -359,18 +359,18 @@ class GrantsReviewAdapter:
"""Adapter for handling Grants (Financial Aid) reviews."""

@property
def recap_template(self) -> str:
return "grants-recap.html"
def shortlist_template(self) -> str:
return "grants-shortlist.html"

@property
def review_template(self) -> str:
return "grant-review.html"

def get_recap_items_queryset(
def get_shortlist_items_queryset(
self,
review_session: ReviewSession,
) -> QuerySet[Grant]:
"""Return grants annotated with scores and std_dev for the recap view."""
"""Return grants annotated with scores and std_dev for the shortlist view."""
review_session_id = review_session.id

return (
Expand Down Expand Up @@ -433,14 +433,14 @@ def get_recap_items_queryset(
)
)

def get_recap_context(
def get_shortlist_context(
self,
request: HttpRequest,
review_session: ReviewSession,
items: QuerySet,
admin_site: AdminSite,
) -> dict[str, Any]:
"""Return template context for the grants recap view."""
"""Return template context for the grants shortlist view."""
proposals = {
submission.id: submission
for submission in Submission.objects.non_cancelled()
Expand Down Expand Up @@ -468,10 +468,10 @@ def get_recap_context(
conference=review_session.conference
),
review_session=review_session,
title="Recap",
title="Shortlist",
)

def process_recap_post(
def process_shortlist_post(
self,
request: HttpRequest,
review_session: ReviewSession,
Expand Down
Loading
Loading