# Path: pagelets/views.py
# def view_page(request, page_slug, template="pagelets/view_page.html"):
# def create_pagelet(request, pagelet_slug=None):
# def _last_modified(request, pagelet_id):
# def _etag(request, pagelet_id):
# def edit_pagelet(
#     request,
#     pagelet_id,
#     template="pagelets/edit_pagelet.html",
#     redirect_field_name=REDIRECT_FIELD_NAME,
#     redirect_to=None,
# ):
#     def _(request):
# def remove_pagelet(
#     request,
#     pagelet_id,
#     template="pagelets/remove_pagelet.html",
#     redirect_field_name=REDIRECT_FIELD_NAME,
#     redirect_to=None,
# ):
# def add_attachment(
#     request,
#     page_slug,
#     template="pagelets/attach.html",
# ):
# def remove_attachment(request, page_slug, attachment_id):
# 
# Path: pagelets/validators.py
# PAGE_SLUG_RE = r"[-\w/\.~]+"


from django.urls import re_path
from pagelets import views
from pagelets.validators import PAGE_SLUG_RE


urlpatterns = [
    re_path(
        r"^pagelet/(?:(?P<pagelet_slug>[^/]+)/)?create/$",
        views.create_pagelet,
        name="create_pagelet",
    ),
    re_path(
        r"^pagelet/(?P<pagelet_id>\d+)/edit/$",
        views.edit_pagelet,
        name="edit_pagelet",
    ),
    re_path(
        r"^pagelet/(?P<pagelet_id>\d+)/remove/$",
        views.remove_pagelet,
        name="remove_pagelet",
    ),
    re_path(
        r"^page/(?P<page_slug>%s)/attachment/upload/$" % PAGE_SLUG_RE,
        views.add_attachment,
        name="add_attachment",
    ),
    re_path(
        r"^page/(?P<page_slug>%s)/attachment/(?P<attachment_id>\d+)/remove/$"

# Path: pagelets/views.py
# def view_page(request, page_slug, template="pagelets/view_page.html"):
# def create_pagelet(request, pagelet_slug=None):
# def _last_modified(request, pagelet_id):
# def _etag(request, pagelet_id):
# def edit_pagelet(
#     request,
#     pagelet_id,
#     template="pagelets/edit_pagelet.html",
#     redirect_field_name=REDIRECT_FIELD_NAME,
#     redirect_to=None,
# ):
#     def _(request):
# def remove_pagelet(
#     request,
#     pagelet_id,
#     template="pagelets/remove_pagelet.html",
#     redirect_field_name=REDIRECT_FIELD_NAME,
#     redirect_to=None,
# ):
# def add_attachment(
#     request,
#     page_slug,
#     template="pagelets/attach.html",
# ):
# def remove_attachment(request, page_slug, attachment_id):
# 
# Path: pagelets/validators.py
# PAGE_SLUG_RE = r"[-\w/\.~]+"


# Path: pagelets/urls/management.py
from django.urls import re_path
from pagelets import views
from pagelets.validators import PAGE_SLUG_RE



urlpatterns = [
    re_path(
        r"^pagelet/(?:(?P<pagelet_slug>[^/]+)/)?create/$",
        views.create_pagelet,
        name="create_pagelet",
    ),
    re_path(
        r"^pagelet/(?P<pagelet_id>\d+)/edit/$",
        views.edit_pagelet,
        name="edit_pagelet",
    ),
    re_path(
        r"^pagelet/(?P<pagelet_id>\d+)/remove/$",
        views.remove_pagelet,
        name="remove_pagelet",
    ),
    re_path(
        r"^page/(?P<page_slug>%s)/attachment/upload/$" % PAGE_SLUG_RE,
        views.add_attachment,
        name="add_attachment",
    ),
    re_path(
        r"^page/(?P<page_slug>%s)/attachment/(?P<attachment_id>\d+)/remove/$"

        % PAGE_SLUG_RE,