diff --git a/coding_night_live/urls.py b/coding_night_live/urls.py index c9115e2..79b0c36 100644 --- a/coding_night_live/urls.py +++ b/coding_night_live/urls.py @@ -30,11 +30,11 @@ url(r'^$', MainView.as_view(), name='main'), url(r'^admin/', admin.site.urls), url(r'^accounts/', include(custom_conf)), - url(r'^services/$', manage_room.views.RoomListView, name='services'), - url(r'^services/new/', manage_room.views.RoomCreateView, name='new'), + url(r'^services/$', manage_room.views.room_list_view, name='services'), + url(r'^services/new/', manage_room.views.room_create_view, name='new'), url( r'^services/delete/(?P([a-z]{3,}-[a-z]{3,}-[0-9]{1,4}))/$', - manage_room.views.RoomDeleteView, + manage_room.views.room_delete_view, name='delete' ), url( @@ -44,7 +44,7 @@ ), url( r'^([a-z]{3,}-[a-z]{3,}-[0-9]{1,4})/pdf/$', - manage_room.views.MarkdownToPdfView, + manage_room.views.markdown_to_pdf_view, name='get_pdf' ), url(r'^auth/', include('django.contrib.auth.urls'), {'next_page': '/'}), diff --git a/manage_room/views.py b/manage_room/views.py index e54118f..7709e5a 100644 --- a/manage_room/views.py +++ b/manage_room/views.py @@ -13,7 +13,7 @@ @login_required -def RoomCreateView(request): +def room_create_view(request): url = '/' room = None @@ -41,7 +41,7 @@ def RoomCreateView(request): # Delete a room @login_required -def RoomDeleteView(request, pk): +def room_delete_view(request, pk): Room.objects.filter(admin_user=request.user, label=pk).delete() url = '/services' return HttpResponseRedirect(url) @@ -49,13 +49,13 @@ def RoomDeleteView(request, pk): # Check room list @login_required -def RoomListView(request): +def room_list_view(request): rooms = Room.objects.filter(admin_user=request.user).order_by('time') return render(request, 'list.html', {'rooms': rooms}) # Convert markdown to pdf -def MarkdownToPdfView(request, label): +def markdown_to_pdf_view(request, label): label = label.strip('/') try: room = Room.objects.get(label=label)