temp public listing for sharing
This commit is contained in:
parent
26555311f7
commit
5c6a2f6105
|
@ -4,17 +4,17 @@ from . import views
|
|||
from .views import ColleListView
|
||||
|
||||
urlpatterns = [
|
||||
path("", lambda req: redirect("colloscope:dashboard"), name="home"),
|
||||
path("table", views.colloscope, name="table"),
|
||||
path("dashboard", views.dashboard, name="dashboard"),
|
||||
path("/", lambda req: redirect("colloscope:dashboard"), name="home"),
|
||||
path("table/", views.colloscope, name="table"),
|
||||
path("dashboard/", views.dashboard, name="dashboard"),
|
||||
path("export.pdf", views.export, name="export"),
|
||||
path("export/calendar/<str:key>/calendar.ics", views.icalendar, name="export-ics"),
|
||||
path("calendrier.ics",
|
||||
lambda req: redirect("colloscope:export-ics", key=req.GET.get("key")), name="export-ics-old"),
|
||||
path("marketplace", views.marketplace, name="marketplace"),
|
||||
path("action/enroll", views.enroll, name="enroll"),
|
||||
path("action/withdraw", views.withdraw, name="withdraw"),
|
||||
path("listing/", ColleListView.as_view(), name="colles"),
|
||||
path("listing/by_subject/<int:subject>/", ColleListView.as_view(), name="colles_by_subject"),
|
||||
path("listing/by_colleur/<int:colleur>/", ColleListView.as_view(), name="colles_by_colleur"),
|
||||
path("marketplace/", views.marketplace, name="marketplace"),
|
||||
path("action/enroll/", views.enroll, name="enroll"),
|
||||
path("action/withdraw/", views.withdraw, name="withdraw"),
|
||||
path("listing/<int:term>/", ColleListView.as_view(), name="colles"),
|
||||
path("listing/<int:term>/by_subject/<int:subject>/", ColleListView.as_view(), name="colles_by_subject"),
|
||||
path("listing/<int:term>/by_colleur/<int:colleur>/", ColleListView.as_view(), name="colles_by_colleur"),
|
||||
]
|
||||
|
|
|
@ -25,13 +25,15 @@ class ColleListView(LoginRequiredMixin, ListView):
|
|||
context_object_name = "colles"
|
||||
|
||||
def get_queryset(self):
|
||||
student = self.request.user.profile.student
|
||||
base_query = (student.cls
|
||||
term = Term.objects.get(pk=self.kwargs.get("term"))
|
||||
base_query = (term.cls
|
||||
.current_term()
|
||||
.query_colles()
|
||||
.filter(datetime__gte=date.today()))
|
||||
|
||||
if self.kwargs.get("subject") is not None:
|
||||
print(base_query)
|
||||
print(self.kwargs.get("subject"))
|
||||
base_query = base_query.filter(slot__subject__id=self.kwargs.get("subject"))
|
||||
if self.kwargs.get("colleur") is not None:
|
||||
base_query = base_query.filter(slot__colleur__id=self.kwargs.get("colleur"))
|
||||
|
|
Loading…
Reference in New Issue