You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

33 lines
966 B

try:
from django.urls import include, re_path
except ImportError:
from django.conf.urls import include, url as re_path
from django.contrib.admin.views.decorators import staff_member_required
from . import views
from .registries import global_preferences_registry
from .forms import GlobalPreferenceForm
app_name = "dynamic_preferences"
urlpatterns = [
re_path(
r"^global/$",
staff_member_required(
views.PreferenceFormView.as_view(
registry=global_preferences_registry, form_class=GlobalPreferenceForm
)
),
name="global",
),
re_path(
r"^global/(?P<section>[\w\ ]+)$",
staff_member_required(
views.PreferenceFormView.as_view(
registry=global_preferences_registry, form_class=GlobalPreferenceForm
)
),
name="global.section",
),
re_path(r"^user/", include("dynamic_preferences.users.urls")),
]