diff --git a/uber/models/__init__.py b/uber/models/__init__.py index 67de7712d..9a42d5183 100644 --- a/uber/models/__init__.py +++ b/uber/models/__init__.py @@ -865,7 +865,7 @@ def access_query_matrix(self): return_dict['panels_admin'] = self.query(Attendee).outerjoin(PanelApplicant).filter( or_(Attendee.ribbon.contains(c.PANELIST_RIBBON), - Attendee.panel_applications != None, # noqa: E711 + Attendee.submitted_panels != None, # noqa: E711 Attendee.assigned_panelists != None, # noqa: E711 Attendee.panel_applicants != None, # noqa: E711 Attendee.panel_feedback != None)) # noqa: E711 diff --git a/uber/models/attendee.py b/uber/models/attendee.py index db5a73c73..377c92569 100644 --- a/uber/models/attendee.py +++ b/uber/models/attendee.py @@ -402,6 +402,13 @@ class Attendee(MagModel, TakesPaymentMixin): panel_applicants = relationship('PanelApplicant', backref='attendee') panel_applications = relationship('PanelApplication', backref='poc') panel_feedback = relationship('EventFeedback', backref='attendee') + submitted_panels = relationship( + 'PanelApplication', + secondary='panel_applicant', + secondaryjoin='and_(PanelApplicant.app_id == PanelApplication.id)', + primaryjoin='and_(Attendee.id == PanelApplicant.attendee_id, PanelApplicant.submitter == True)', + viewonly=True + ) # ========================= # attractions diff --git a/uber/models/guests.py b/uber/models/guests.py index bbb07702d..7e0633789 100644 --- a/uber/models/guests.py +++ b/uber/models/guests.py @@ -140,9 +140,9 @@ def merch_status(self): @property def panel_status(self): - application_count = len(self.group.leader.panel_applications) + application_count = len(self.group.leader.submitted_panels) return '{} Panel Application(s)'.format(application_count) \ - if self.group.leader.panel_applications else self.status('panel') + if self.group.leader.submitted_panels else self.status('panel') @property def mc_status(self): diff --git a/uber/site_sections/guest_reports.py b/uber/site_sections/guest_reports.py index fa8f2cc5a..0178dbfa6 100644 --- a/uber/site_sections/guest_reports.py +++ b/uber/site_sections/guest_reports.py @@ -38,6 +38,9 @@ def checklist_info_csv(self, out, session): for guest in [guest for guest in session.query(GuestGroup).all() if session.admin_can_see_guest_group(guest)]: absolute_pic_url = convert_to_absolute_url(getattr(guest.bio, 'pic_url', '')) absolute_stageplot_url = convert_to_absolute_url(getattr(guest.stage_plot, 'url', '')) + num_panels = 0 if not guest.group or not guest.group.leader or not guest.group.leader.submitted_panels \ + else len(guest.group.leader.submitted_panels) + out.writerow([ guest.group_type_label, guest.group.name, guest.email, guest.payment, guest.vehicles, guest.num_hotel_rooms, @@ -49,10 +52,7 @@ def checklist_info_csv(self, out, session): getattr(guest.bio, 'twitter', ''), getattr(guest.bio, 'instagram', ''), getattr(guest.bio, 'twitch', ''), getattr(guest.bio, 'bandcamp', ''), getattr(guest.bio, 'discord', ''), getattr(guest.bio, 'other_social_media', ''), - getattr(guest.bio, 'pic_filename', ''), absolute_pic_url, - getattr(guest.panel, 'wants_panel', ''), getattr(guest.panel, 'name', ''), - getattr(guest.panel, 'length', ''), getattr(guest.panel, 'desc', ''), - ' / '.join(getattr(guest.panel, 'panel_tech_needs_labels', '')), + getattr(guest.bio, 'pic_filename', ''), absolute_pic_url, num_panels, getattr(guest.autograph, 'num', ''), getattr(guest.autograph, 'length', ''), getattr(guest.autograph, 'rock_island_autographs', ''), getattr(guest.autograph, 'rock_island_length', ''), @@ -78,6 +78,26 @@ def detailed_travel_info_csv(self, out, session): time_day_local(plan.departure_time), plan.departure_details, plan.extra_details]) out.writerow(content_row) + + @csv_file + def panel_info_csv(self, out, session): + out.writerow(['Guest', 'App Status', 'Name', 'Description', 'Schedule Description', 'Length', + 'Department', 'Type of Panel', 'Location', 'Date/Time']) + for guest in session.query(GuestGroup): + if guest.group and guest.group.leader: + for app in guest.group.leader.submitted_panels: + out.writerow([ + guest.group.name, app.status_label, + getattr(app.event, 'name', app.name), + getattr(app.event, 'description', app.description), + getattr(app.event, 'public_description', app.public_description), + f"{app.event.minutes} minutes" if app.event else f"{app.length_label} (expected)", + app.department_label, + app.other_presentation if app.presentation == c.OTHER else app.presentation_label, + getattr(app.event, 'location_label', '(not scheduled)'), + app.event.timespan(minute_increment=30) if app.event else '(not scheduled)', + ]) + @site_mappable def rock_island(self, session, message='', only_empty=None, id=None, **params): diff --git a/uber/site_sections/panels_admin.py b/uber/site_sections/panels_admin.py index 68ce2552d..99066db98 100644 --- a/uber/site_sections/panels_admin.py +++ b/uber/site_sections/panels_admin.py @@ -285,7 +285,7 @@ def everything(self, out, session): out.writerow([ app.name, app.description, - app.length, + app.length_label, app.unavailable, app.past_attendance, app.affiliations, diff --git a/uber/templates/group_admin/guests.html b/uber/templates/group_admin/guests.html index 0f137a53e..803e7e079 100644 --- a/uber/templates/group_admin/guests.html +++ b/uber/templates/group_admin/guests.html @@ -53,4 +53,5 @@
Export all checklist data as a CSV file
+ {% endif %} diff --git a/uber/templates/guest_admin/checklist_info.html b/uber/templates/guest_admin/checklist_info.html index d89fc8474..056bc6197 100644 --- a/uber/templates/guest_admin/checklist_info.html +++ b/uber/templates/guest_admin/checklist_info.html @@ -8,14 +8,14 @@