site_tps/users/urls.py
2018-03-02 09:33:37 +01:00

85 lines
1.6 KiB
Python

from django.urls import path
from .views import (
CreateUser,
CreateUserProfile,
CreateSchool,
EditSchoolName,
EditSchoolPhone,
DeleteSchool,
Login,
Logout,
PasswordChange,
Profile,
School,
promote_user,
degrade_user
)
app_name = 'users'
urlpatterns = [
path(
'user/new',
CreateUser.as_view(),
name='new-user'
),
path(
'login',
Login.as_view(),
name='login'
),
path(
'logout',
Logout.as_view(),
name='logout',
),
path(
'change_password',
PasswordChange.as_view(),
name='change-password'
),
path(
'user/<int:pk>/set_school',
CreateUserProfile.as_view(),
name='create-userprofile'
),
path(
'user/<int:pk>',
Profile.as_view(),
name='profile',
),
path(
'school/new',
CreateSchool.as_view(),
name='new-school'
),
path(
'school/<int:pk>',
School.as_view(),
name='school'
),
path(
'school/<int:school_pk>/degrade/<int:user_pk>',
degrade_user,
name='degrade-user'
),
path(
'school/<int:school_pk>/promote/<int:user_pk>',
promote_user,
name='promote-user'
),
path(
'school/<int:pk>/edit_name',
EditSchoolName.as_view(),
name='edit-school-name'
),
path(
'school/<int:pk>/edit_phone',
EditSchoolPhone.as_view(),
name='edit-school-phone'
),
path(
'school/<int:pk>/delete',
DeleteSchool.as_view(),
name='delete-school'
),
]