diff --git a/make_queue/models/__init__.py b/make_queue/models/__init__.py index 50402bc92..e69de29bb 100644 --- a/make_queue/models/__init__.py +++ b/make_queue/models/__init__.py @@ -1,4 +0,0 @@ -__all__ = ['course', 'machine', 'reservation'] - -for _import in __all__: - __import__(f"{__package__}.{_import}") diff --git a/make_queue/urls.py b/make_queue/urls.py index 0df36b353..f4470f64d 100644 --- a/make_queue/urls.py +++ b/make_queue/urls.py @@ -2,37 +2,40 @@ from django.urls import include, path, register_converter from . import converters -from .views import admin, api, quota, reservation +from .views.admin import course, quota, reservation as reservation_admin +from .views.api import calendar as calendar_api, reservation as reservation_api, user_info +from .views.quota import user +from .views.reservation import calendar, machine, reservation, rules register_converter(converters.Year, 'year') register_converter(converters.Week, 'week') machine_urlpatterns = [ - path("create/", permission_required('make_queue.add_machine')(reservation.machine.CreateMachineView.as_view()), name='create_machine'), - path("/edit/", permission_required('make_queue.change_machine')(reservation.machine.EditMachineView.as_view()), name='edit_machine'), - path("/delete/", permission_required('make_queue.delete_machine')(reservation.machine.DeleteMachineView.as_view()), + path("create/", permission_required('make_queue.add_machine')(machine.CreateMachineView.as_view()), name='create_machine'), + path("/edit/", permission_required('make_queue.change_machine')(machine.EditMachineView.as_view()), name='edit_machine'), + path("/delete/", permission_required('make_queue.delete_machine')(machine.DeleteMachineView.as_view()), name='delete_machine'), ] calendar_urlpatterns = [ - path("/reservations/", api.calendar.APIReservationListView.as_view(), name='api_reservations'), - path("/rules/", api.calendar.APIReservationRuleListView.as_view(), name='api_reservation_rules'), + path("/reservations/", calendar_api.APIReservationListView.as_view(), name='api_reservations'), + path("/rules/", calendar_api.APIReservationRuleListView.as_view(), name='api_reservation_rules'), ] json_urlpatterns = [ - path("/", login_required(api.reservation.APIMachineDataView.as_view()), name='reservation_json'), - path("//", login_required(api.reservation.APIMachineDataView.as_view()), name='reservation_json'), - path("/", permission_required('make_queue.add_printer3dcourse')(api.user_info.get_user_info_from_username), name='user_json'), + path("/", login_required(reservation_api.APIMachineDataView.as_view()), name='reservation_json'), + path("//", login_required(reservation_api.APIMachineDataView.as_view()), name='reservation_json'), + path("/", permission_required('make_queue.add_printer3dcourse')(user_info.get_user_info_from_username), name='user_json'), ] rules_urlpatterns = [ - path("", reservation.rules.ReservationRuleListView.as_view(), name='reservation_rule_list'), - path("create/", reservation.rules.CreateReservationRuleView.as_view(), name='create_reservation_rule'), - path("/edit/", reservation.rules.EditReservationRuleView.as_view(), name='edit_reservation_rule'), - path("/delete/", reservation.rules.DeleteReservationRuleView.as_view(), name='delete_reservation_rule'), - path("usage/", reservation.rules.MachineUsageRulesDetailView.as_view(), name='machine_usage_rules_detail'), - path("usage/edit/", reservation.rules.EditUsageRulesView.as_view(), name='edit_machine_usage_rules'), + path("", rules.ReservationRuleListView.as_view(), name='reservation_rule_list'), + path("create/", rules.CreateReservationRuleView.as_view(), name='create_reservation_rule'), + path("/edit/", rules.EditReservationRuleView.as_view(), name='edit_reservation_rule'), + path("/delete/", rules.DeleteReservationRuleView.as_view(), name='delete_reservation_rule'), + path("usage/", rules.MachineUsageRulesDetailView.as_view(), name='machine_usage_rules_detail'), + path("usage/edit/", rules.EditUsageRulesView.as_view(), name='edit_machine_usage_rules'), ] specific_machinetype_urlpatterns = [ @@ -40,47 +43,47 @@ ] quota_urlpatterns = [ - path("", permission_required('make_queue.change_quota', raise_exception=True)(admin.quota.QuotaPanelView.as_view()), name='quota_panel'), - path("create/", permission_required('make_queue.add_quota')(admin.quota.CreateQuotaView.as_view()), name='create_quota'), - path("/update/", permission_required('make_queue.change_quota')(admin.quota.EditQuotaView.as_view()), name='edit_quota'), - path("/delete/", permission_required('make_queue.delete_quota')(admin.quota.DeleteQuotaView.as_view()), name='delete_quota'), - path("user//", permission_required('make_queue.change_quota', raise_exception=True)(quota.user.UserQuotaListView.as_view()), + path("", permission_required('make_queue.change_quota', raise_exception=True)(quota.QuotaPanelView.as_view()), name='quota_panel'), + path("create/", permission_required('make_queue.add_quota')(quota.CreateQuotaView.as_view()), name='create_quota'), + path("/update/", permission_required('make_queue.change_quota')(quota.EditQuotaView.as_view()), name='edit_quota'), + path("/delete/", permission_required('make_queue.delete_quota')(quota.DeleteQuotaView.as_view()), name='delete_quota'), + path("user//", permission_required('make_queue.change_quota', raise_exception=True)(user.UserQuotaListView.as_view()), name='user_quota_list'), - path("/", permission_required('make_queue.change_quota', raise_exception=True)(admin.quota.QuotaPanelView.as_view()), + path("/", permission_required('make_queue.change_quota', raise_exception=True)(quota.QuotaPanelView.as_view()), name='quota_panel'), ] course_urlpatterns = [ - path("", permission_required('make_queue.change_printer3dcourse')(admin.course.Printer3DCourseListView.as_view()), + path("", permission_required('make_queue.change_printer3dcourse')(course.Printer3DCourseListView.as_view()), name='course_registration_list'), - path("status/", permission_required('make_queue.change_printer3dcourse')(admin.course.BulkStatusUpdate.as_view()), name='bulk_status_update'), - path("download/", permission_required('make_queue.change_printer3dcourse')(admin.course.CourseXLSXView.as_view()), + path("status/", permission_required('make_queue.change_printer3dcourse')(course.BulkStatusUpdate.as_view()), name='bulk_status_update'), + path("download/", permission_required('make_queue.change_printer3dcourse')(course.CourseXLSXView.as_view()), name='download_course_registrations'), - path("create/", permission_required('make_queue.add_printer3dcourse')(admin.course.CreateCourseRegistrationView.as_view()), + path("create/", permission_required('make_queue.add_printer3dcourse')(course.CreateCourseRegistrationView.as_view()), name='create_course_registration'), - path("create/success/", permission_required('make_queue.add_printer3dcourse')(admin.course.CreateCourseRegistrationView.as_view(is_next=True)), + path("create/success/", permission_required('make_queue.add_printer3dcourse')(course.CreateCourseRegistrationView.as_view(is_next=True)), name='create_course_registration_success'), - path("/edit/", permission_required('make_queue.change_printer3dcourse')(admin.course.EditCourseRegistrationView.as_view()), + path("/edit/", permission_required('make_queue.change_printer3dcourse')(course.EditCourseRegistrationView.as_view()), name='edit_course_registration'), - path("/delete/", permission_required('make_queue.delete_printer3dcourse')(admin.course.DeleteCourseRegistrationView.as_view()), + path("/delete/", permission_required('make_queue.delete_printer3dcourse')(course.DeleteCourseRegistrationView.as_view()), name='delete_course_registration'), ] urlpatterns = [ - path("", reservation.machine.MachineListView.as_view(), name='machine_list'), + path("", machine.MachineListView.as_view(), name='machine_list'), path("machine/", include(machine_urlpatterns)), - path("///", reservation.calendar.MachineDetailView.as_view(), name='machine_detail'), + path("///", calendar.MachineDetailView.as_view(), name='machine_detail'), path("calendar/", include(calendar_urlpatterns)), path("json/", include(json_urlpatterns)), - path("create//", login_required(reservation.reservation.CreateReservationView.as_view()), name='create_reservation'), - path("/edit/", login_required(reservation.reservation.EditReservationView.as_view()), name='edit_reservation'), - path("/finish/", login_required(reservation.reservation.MarkReservationFinishedView.as_view()), name='mark_reservation_finished'), - path("/", login_required(reservation.reservation.DeleteReservationView.as_view()), name='delete_reservation'), - path("me/", reservation.reservation.MyReservationsListView.as_view(), name='my_reservations_list'), + path("create//", login_required(reservation.CreateReservationView.as_view()), name='create_reservation'), + path("/edit/", login_required(reservation.EditReservationView.as_view()), name='edit_reservation'), + path("/finish/", login_required(reservation.MarkReservationFinishedView.as_view()), name='mark_reservation_finished'), + path("/", login_required(reservation.DeleteReservationView.as_view()), name='delete_reservation'), + path("me/", reservation.MyReservationsListView.as_view(), name='my_reservations_list'), path("admin/", - permission_required('make_queue.can_create_event_reservation', raise_exception=True)(admin.reservation.MAKEReservationsListView.as_view()), + permission_required('make_queue.can_create_event_reservation', raise_exception=True)(reservation_admin.MAKEReservationsListView.as_view()), name='MAKE_reservations_list'), - path("slot/", reservation.reservation.FindFreeSlotView.as_view(), name='find_free_slot'), + path("slot/", reservation.FindFreeSlotView.as_view(), name='find_free_slot'), path("machinetypes//", include(specific_machinetype_urlpatterns)), path("quota/", include(quota_urlpatterns)), path("course/", include(course_urlpatterns)), diff --git a/make_queue/views/__init__.py b/make_queue/views/__init__.py index ae2bb09c6..e69de29bb 100644 --- a/make_queue/views/__init__.py +++ b/make_queue/views/__init__.py @@ -1,4 +0,0 @@ -__all__ = ["admin", "api", "quota", "reservation", "stream"] - -for _import in __all__: - __import__(f"{__package__}.{_import}") diff --git a/make_queue/views/admin/__init__.py b/make_queue/views/admin/__init__.py index 21b20be26..e69de29bb 100644 --- a/make_queue/views/admin/__init__.py +++ b/make_queue/views/admin/__init__.py @@ -1,4 +0,0 @@ -__all__ = ["course", "quota", "reservation"] - -for _import in __all__: - __import__(f"{__package__}.{_import}") diff --git a/make_queue/views/api/__init__.py b/make_queue/views/api/__init__.py index 4e3f386be..e69de29bb 100644 --- a/make_queue/views/api/__init__.py +++ b/make_queue/views/api/__init__.py @@ -1,4 +0,0 @@ -__all__ = ["reservation", "user_info", "calendar"] - -for _import in __all__: - __import__(f"{__package__}.{_import}") diff --git a/make_queue/views/quota/__init__.py b/make_queue/views/quota/__init__.py index 1c1ae3c78..e69de29bb 100644 --- a/make_queue/views/quota/__init__.py +++ b/make_queue/views/quota/__init__.py @@ -1,4 +0,0 @@ -__all__ = ["user"] - -for _import in __all__: - __import__(f"{__package__}.{_import}") diff --git a/make_queue/views/reservation/__init__.py b/make_queue/views/reservation/__init__.py index 217cc2bfe..e69de29bb 100644 --- a/make_queue/views/reservation/__init__.py +++ b/make_queue/views/reservation/__init__.py @@ -1,4 +0,0 @@ -__all__ = ["calendar", "machine", "reservation", "rules"] - -for _import in __all__: - __import__(f"{__package__}.{_import}")