Example #1
1
    def get_urls(self):

        try:
            from django.conf.urls import patterns, url
        except ImportError:
            from django.conf.urls.defaults import patterns, url

        def wrap(view):
            def wrapper(*args, **kwargs):
                return self.admin_site.admin_view(view)(*args, **kwargs)

            return update_wrapper(wrapper, view)

        urls = super(SectionAdmin, self).get_urls()
        info = self.model._meta.app_label, self.model._meta.module_name
        return (
            patterns(
                "",
                url(r"^(.+)/create/$", wrap(self.custom_add_view), name="%s_%s_create" % info),
                url(r"^(.+)/move/$", wrap(self.move_view), name="%s_%s_move" % info),
                url(r"^(.+)/related/$", wrap(self.related_content_view), name="%s_%s_related" % info),
                url(r"^(.+)/order/$", wrap(self.order_content_view), name="%s_%s_order" % info),
            )
            + urls
        )
Example #2
1
    def _decorated_urls(self):
        urlpatterns = self._get_default_urlpatterns()

        default_panel = None

        # Add in each panel's views except for the default view.
        for panel in self._registry.values():
            if panel.slug == self.default_panel:
                default_panel = panel
                continue
            url_slug = panel.slug.replace(".", "/")
            urlpatterns += patterns("", url(r"^%s/" % url_slug, include(panel._decorated_urls)))
        # Now the default view, which should come last
        if not default_panel:
            raise NotRegistered('The default panel "%s" is not registered.' % self.default_panel)
        urlpatterns += patterns("", url(r"", include(default_panel._decorated_urls)))

        # Require login if not public.
        if not self.public:
            _decorate_urlconf(urlpatterns, require_auth)
        # Apply access controls to all views in the patterns
        permissions = getattr(self, "permissions", [])
        _decorate_urlconf(urlpatterns, require_perms, permissions)
        _decorate_urlconf(urlpatterns, _current_component, dashboard=self)

        # Return the three arguments to django.conf.urls.include
        return urlpatterns, self.slug, self.slug
Example #3
1
    def get_tool_urls(self):
        """Gets the url patterns that route each tool to a special view."""

        tools = {}
        # Both objectactions and modelactions should be a list type (like in admin actions)
        # Some people (and tox test units) use type instead, so to keep backward copatybility
        # I cast them to list.
        for tool in list(self.objectactions) + list(self.modelactions):
            # TODO - check if this is enought to have tools splited over different instances
            # in case where DjangoObjectActions mixin is used with few ModelAdmin subclasses.
            if hasattr(self, tool):
                tools[tool] = getattr(self, tool)

        my_urls = []
        if self.objectactions:
            my_urls.append(
                url(
                    r"^(?P<pk>\d+)/tools/(?P<tool>\w+)/$",
                    self.admin_site.admin_view(ObjectToolsView.as_view(model=self.model, tools=tools)),
                )
            )

        if self.modelactions:
            my_urls.append(
                url(
                    r"tools/(?P<tool>\w+)/$",
                    self.admin_site.admin_view(ModelToolsView.as_view(model=self.model, tools=tools)),
                )
            )

        return my_urls
    def get_urls(self):
        from django.conf.urls import patterns, url

        def wrap(view):
            def wrapper(*args, **kwargs):
                return self.admin_site.admin_view(view)(*args, **kwargs)

            return update_wrapper(wrapper, view)

        return (
            patterns(
                "",
                url(
                    r"^(.+)/move-(up)/$",
                    wrap(self.move_view),
                    name="{app}_{model}_order_up".format(**self._get_model_info()),
                ),
                url(
                    r"^(.+)/move-(down)/$",
                    wrap(self.move_view),
                    name="{app}_{model}_order_down".format(**self._get_model_info()),
                ),
            )
            + super(OrderedModelAdmin, self).get_urls()
        )
def get_interspersed_urls(exts, binaryview_kwargs=None, pageview_kwargs=None):
    # Note: you can prefix your URLs via existing urlpatterns mechanisms.

    # FIXME: this could be more efficient by making a single FBO with
    # pageview_excludes as a filter, then enumerating it, and passing
    # that to all the binary views. (It should be possible to avoid
    # walking the tree so much this way. At the moment it'll be done
    # once per request, which is tedious.)
    urls = []
    pageview_excludes = []
    if binaryview_kwargs is None:
        binaryview_kwargs = {}
    for ext in exts:
        urls.append(
            url(
                r"^(?P<slug>.*\.%(ext)s)$" % {"ext": ext},
                InterspersedBinaryView.as_view(ext=ext, **binaryview_kwargs),
                name=ext,
            )
        )
        pageview_excludes.append(Q(name__glob="*.%s" % ext))
    if pageview_kwargs is None:
        pageview_kwargs = {}
    if "queryset" not in pageview_kwargs:
        pageview_kwargs["queryset"] = InterspersedPageView.queryset
    pageview_kwargs["queryset"] = pageview_kwargs["queryset"].exclude(reduce(lambda x, y: x | y, pageview_excludes))
    urls.append(url(r"^(?P<slug>.*)$", InterspersedPageView.as_view(**pageview_kwargs), name="page"))
    return urls
Example #6
1
 def get_urls(self, prefix=None):
     prefix = prefix or "satchless-productset"
     return patterns(
         "",
         url(r"^$", self.index_view, name=prefix),
         url(r"^(?P<slug>[a-z0-9_-]+)/$", self.details_view, name="%s-details" % (prefix,)),
     )
Example #7
0
    def _get_url_patterns(self):
        # Fetch the names of the views
        # ie: v1_foo_list
        list_view_name, detail_view_name = self._get_view_names()

        # Create url patterns
        # ie detail: r'foo/(?P<pk>\w+)/$
        resource_pattern = []
        api = getattr(self.Meta, "api", None)
        if api:
            resource_pattern.append(api.api_url)
        resource_pattern.append(self._get_resource_name())
        resource_pattern = "/".join(resource_pattern)
        list_view_pattern = r"^{0}/$".format(resource_pattern)
        detail_view_pattern = r"^{0}/(?P<{1}>\w+)/$".format(resource_pattern, self.Meta.pk_field)

        # Form all the views
        list_view = url(list_view_pattern, self.view, name=list_view_name)
        detail_view = url(detail_view_pattern, self.view, name=detail_view_name)

        # Return list of patterns
        patterns = []
        patterns.append(list_view)
        patterns.append(detail_view)

        return patterns
 def get_urls(self):
     urlpatterns = patterns(
         "",
         url(r"^fps-notify-handler/$", self.fps_ipn_handler, name="fps_ipn_handler"),
         url(r"^fps-return-url/$", self.fps_return_url, name="fps_return_url"),
     )
     return urlpatterns
def apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required):
    ret = []
    for urlpattern in urlpatterns:
        if isinstance(urlpattern, RegexURLResolver):
            # Set of included URL patterns
            regex = urlpattern.regex.pattern
            namespace = urlpattern.namespace
            app_name = urlpattern.app_name
            kwargs = urlpattern.default_kwargs
            # Add in the included patterns, after applying the suffixes
            patterns = apply_suffix_patterns(urlpattern.url_patterns, suffix_pattern, suffix_required)
            ret.append(url(regex, include(patterns, namespace, app_name), kwargs))

        else:
            # Regular URL pattern
            regex = urlpattern.regex.pattern.rstrip("$").rstrip("/") + suffix_pattern
            view = urlpattern._callback or urlpattern._callback_str
            kwargs = urlpattern.default_args
            name = urlpattern.name
            # Add in both the existing and the new urlpattern
            if not suffix_required:
                ret.append(urlpattern)
            ret.append(url(regex, view, kwargs, name))

    return ret
Example #10
0
def create_urls(backend):
    return patterns(
        "",
        url(
            r"^activate/complete/$",
            "django.views.generic.simple.direct_to_template",
            {"template": "registration/activation_complete.html"},
            name="registration_activation_complete",
        ),
        # Activation keys get matched by \w+ instead of the more specific
        # [a-fA-F0-9]{40} because a bad activation key should still get to the view;
        # that way it can return a sensible "invalid key" message instead of a
        # confusing 404.
        url(
            r"^activate/(?P<activation_key>\w+)/$",
            "registration.views.activate",
            {"backend": backend},
            name="registration_activate",
        ),
        url(r"^register/$", "registration.views.register", {"backend": backend}, name="register"),
        url(
            r"^register/complete/$",
            "django.views.generic.simple.direct_to_template",
            {"template": "registration/registration_complete.html"},
            name="registration-complete",
        ),
        url(
            r"^register/closed/$",
            "django.views.generic.simple.direct_to_template",
            {"template": "registration/registration_closed.html"},
            name="registration-disabled",
        ),
    )
Example #11
0
    def get_urls(self):

        from djangobmf.urls import urlpatterns

        try:
            ct = ContentType.objects.get_for_model(Configuration)
            self.activate()
        except RuntimeError:
            # During the migrate command, contenttypes are not ready
            # and raise a Runtime error. We ignore that error and return an empty
            # pattern - the urls are not needed during migrations.
            return patterns("")

        for module, data in self.modules.items():
            info = (module._meta.app_label, module._meta.model_name)
            ct = ContentType.objects.get_for_model(module)

            # set the apis
            urlpatterns += patterns(
                "",
                url(
                    r"^api/module/%s/" % ct.pk, include((data.get_api_urls(), self.app_name, "moduleapi_%s_%s" % info))
                ),
            )

            # Skip detail view if the model is marked as a only related model
            if not module._bmfmeta.only_related:
                urlpatterns += patterns(
                    "",
                    url(
                        r"^detail/%s/%s/(?P<pk>[0-9]+)/" % (info[1], info[0]),
                        include((data.get_detail_urls(), self.app_name, "detail_%s_%s" % info)),
                    ),
                )
        return urlpatterns
Example #12
0
 def get_urls(self):
     urlpatterns = patterns(
         "",
         url(r"^$", self.list_view.as_view(), name="comms-list"),
         url(r"^(?P<code>\w+)/$", self.update_view.as_view(), name="comms-update"),
     )
     return self.post_process_urls(urlpatterns)
Example #13
0
def get_urlpatterns(backend="dfw.registration.backends.default.DefaultBackend"):
    return patterns(
        "",
        url(
            r"^activate/complete/$",
            direct_to_template,
            {"template_name": "registration/activate.html", "backend": backend, "extra_context": {"account": True}},
            name="registration_activation_complete",
        ),
        # Activation keys get matched by \w+ instead of the more specific
        # [a-fA-F0-9]{40} because a bad activation key should still get to the view;
        # that way it can return a sensible "invalid key" message instead of a
        # confusing 404.
        url(r"^activate/(?P<activation_key>\w+)/$", activate, {"backend": backend}, name="registration_activate"),
        url(r"^register/$", register, {"backend": backend}, name="registration_register"),
        url(
            r"^register/complete/$",
            direct_to_template,
            {"template_name": "registration/registration_complete.html", "backend": backend},
            name="registration_complete",
        ),
        url(
            r"^register/closed/$",
            direct_to_template,
            {"template_name": "registration/registration_closed.html", "backend": backend},
            name="registration_disallowed",
        ),
        (r"", include("dfw.registration.auth_urls")),
    )
    def urls(self):
        """Sets up the required urlconf for the admin views."""
        try:
            # > 1.5
            from django.conf.urls import patterns, url
        except ImportError as e:
            # < 1.5
            from django.conf.urls.defaults import patterns, url

        def wrap(view):
            def wrapper(*args, **kwargs):
                return self.admin_site.admin_view(view)(*args, **kwargs)

            return update_wrapper(wrapper, view)

        return patterns(
            "",
            url(
                regex=r"^(?P<content_type>.+)/(?P<pk>.+)/$",
                view=self.view,
                name="%s_%s_change" % (self.model._meta.app_label, self.model._meta.module_name),
            ),
            url(
                regex=r"^$",
                view=self.index,
                name="%s_%s_changelist" % (self.model._meta.app_label, self.model._meta.module_name),
            ),
        )
Example #15
0
    def urls(self):
        """
        Provides URLconf details for the ``Api`` and all registered
        ``Resources`` beneath it.
        """
        if self.api_name:
            api_pattern = "(?P<api_name>%s)"
            top_level = r"^%s%s$" % (api_pattern, trailing_slash())
        else:
            api_pattern = "(?P<api_name>)"
            top_level = r"^$"

        pattern_list = [url(top_level, self.wrap_view("top_level"), name="api_%s_top_level" % self.api_name)]

        for name in sorted(self._registry.keys()):
            self._registry[name].api_name = self.api_name
            pattern_list.append(url(r"^%s" % api_pattern, include(self._registry[name].urls)))

        urlpatterns = self.prepend_urls()

        overridden_urls = self.override_urls()
        if overridden_urls:
            warnings.warn(
                "'override_urls' is a deprecated method & will be removed by v1.0.0. Please rename your method to ``prepend_urls``."
            )
            urlpatterns += overridden_urls

        urlpatterns += pattern_list
        return urlpatterns
Example #16
0
def Mapping(path, handlerklass, name=None, wp=True):
    """
        The generated mappings are messy - we want to much and
        there are two somewhat conflicting systems:

        - explicit instance naming/multi model. The path contains the
          pattern, and 'path' is a possible remained (for ops / handle_*
          methods). In this case, we can restrict path to all handle_*
          methods explicitly by analyzing the handler
        - implicit. Only a base is specified; the "extracted" path is used
          for both coercing an instance and getting an op (handle_*). This
          means it can/may contan a /. E.g. /request/123/foo
          In this case, 'foo' can also be extracted from the handler.
    """
    path = path.strip("/")
    if wp:
        pathpattern = "(?P<path>.*)"
    else:
        pathpattern = ""
    if path:
        pattern = "^%s/%s$" % (path, pathpattern)
    else:
        pattern = "^%s$" % pathpattern
    handler = handlerklass.dispatcher(handlerklass, path=path)
    if name:
        return url(pattern, handler, name=name)
    return url(pattern, handler)
Example #17
0
    def get_urls(self):
        """
        Extends standard admin model urls to manage admins and participants:
        """

        urls = super(ComicSiteAdmin, self).get_urls()
        info = self.model._meta.app_label, self.model._meta.module_name
        myurls = patterns(
            "",
            url(
                r"^(?P<object_pk>.+)/admins/$",
                view=self.admin_site.admin_view(self.admin_add_view),
                name="%s_%s_admins" % info,
            ),
            url(
                r"^(?P<object_pk>.+)/registration_requests/$",
                view=self.admin_site.admin_view(self.registration_requests_view),
                name="%s_%s_participantrequests" % info,
            ),
            # url(r'^(?P<object_pk>.+)/permissions/user-manage/(?P<user_id>\-?\d+)/$',
            #    view=self.admin_site.admin_view(
            #       self.obj_perms_manage_user_view),
            #    name='%s_%s_permissions_manage_user' % info),
            # url(r'^(?P<object_pk>.+)/permissions/group-manage/(?P<group_id>\-?\d+)/$',
            #    view=self.admin_site.admin_view(
            #        self.obj_perms_manage_group_view),
            #    name='%s_%s_permissions_manage_group' % info),
        )
        return myurls + urls
Example #18
0
 def get_urls(self):
     urlpatterns = patterns(
         "",
         url(self.login_url_pattern, self.wrap_view(self.login), name="login"),
         url(self.logout_url_pattern, self.wrap_view(self.logout), name="logout"),
     )
     return urlpatterns
Example #19
0
    def get_url_patterns(self):
        """Returns the Django URL patterns for this object and its children.

        This is used to automatically build up the URL hierarchy for all
        objects. Projects should call this for top-level resources and
        return them in the ``urls.py`` files.
        """
        urlpatterns = never_cache_patterns("", url(r"^$", self, name=self._build_named_url(self.name_plural)))

        for resource in self.list_child_resources:
            resource._parent_resource = self
            child_regex = r"^" + resource.uri_name + r"/"
            urlpatterns += patterns("", url(child_regex, include(resource.get_url_patterns())))

        if self.uri_object_key or self.singleton:
            # If the resource has particular items in it...
            if self.uri_object_key:
                base_regex = r"^(?P<%s>%s)/" % (self.uri_object_key, self.uri_object_key_regex)
            elif self.singleton:
                base_regex = r"^"

            urlpatterns += never_cache_patterns("", url(base_regex + r"$", self, name=self._build_named_url(self.name)))

            for resource in self.item_child_resources:
                resource._parent_resource = self
                child_regex = base_regex + resource.uri_name + r"/"
                urlpatterns += patterns("", url(child_regex, include(resource.get_url_patterns())))

        return urlpatterns
Example #20
0
 def get_urls(self):
     urls = super(MonthlyBatchAdmin, self).get_urls()
     process_urls = [
         url(r"^prepare/$", self.prepare, name="recurring_donations_monthlybatch_prepare"),
         url(r"^process/(?P<pk>\d+)/$", self.process_batch, name="recurring_donations_monthlybatch_process"),
     ]
     return process_urls + urls
Example #21
0
 def patterns(self, flat=False):
     urlpatterns = [url(r"^$", self.index)] + [
         url(r"^%s/" % name, include(child.patterns(self.name))) for name, child in self.children.items()
     ]
     if flat:
         return urlpatterns
     return [url(r"^%s/" % self.name, include(urlpatterns))]
Example #22
0
 def prepend_urls(self):
     """Add urls for resources actions."""
     urls = super(QuotationResource, self).prepend_urls()
     urls.extend(
         (
             url(
                 r"^(?P<resource_name>%s)/(?P<pk>\w[\w/-]*)/make_purchase_order%s$"
                 % (self._meta.resource_name, trailing_slash()),
                 self.wrap_view("make_purchase_order"),
                 name="api_quotation_make_purchase_order",
             ),
             url(
                 r"^(?P<resource_name>%s)/(?P<pk>\w[\w/-]*)/make_down_payment_invoice%s$"
                 % (self._meta.resource_name, trailing_slash()),
                 self.wrap_view("make_down_payment_invoice"),
                 name="api_quotation_make_down_payment_invoice",
             ),
             url(
                 r"^(?P<resource_name>%s)/(?P<pk>\w[\w/-]*)/make_invoice%s$"
                 % (self._meta.resource_name, trailing_slash()),
                 self.wrap_view("make_invoice"),
                 name="api_quotation_make_invoice",
             ),
         )
     )
     return urls
Example #23
0
 def get_urls(self):
     info = self.model._meta.app_label, self.model._meta.module_name
     return patterns(
         "",
         url(r"^$", self.admin_site.admin_view(self.changelist_view), name="%s_%s_changelist" % info),
         url(r"^$", self.admin_site.admin_view(self.changelist_view), name="%s_%s_add" % info),
     )
Example #24
0
def cbv_url_helper(regex, cbv, kwargs=None, name=None, prefix="", login=True):
    """Return an url instance from given regex and class-based view.

    You'd probably want to use import..as statement for loading this function:
    from utils.urls import cbv_url_helper as url
    Then go from this:
    url('^profile$',
        login_required(v.ProfileView.as_view()),
        name='profile')
    To this:
    url('^profile$', v.ProfileView)

    Like the standard url function, it can include() other urlconfs.

    It may not seem much, but as your urls.py file grows bigger and bigger,
    every squished line counts.
    """
    if isinstance(cbv, tuple):
        # Assuming it's a result of an `include` call.
        return url(regex, cbv)

    if not name:
        name = getattr(cbv, "url_name", None)

    view = cbv.as_view()
    if login:
        view = login_required(view)

    return url(regex, view, kwargs=kwargs, name=name, prefix=prefix)
    def base_urls(self):
        base = super(MongoEngineResource, self).base_urls()

        embedded_urls = []
        embedded = (
            name
            for name, obj in self.fields.iteritems()
            if isinstance(obj, tastypie_mongoengine_fields.EmbeddedListField)
        )

        for name in embedded:
            embedded_urls.extend(
                (
                    urls.url(
                        r"^(?P<resource_name>%s)/(?P<pk>\w[\w-]*)/(?P<subresource_name>%s)%s$"
                        % (self._meta.resource_name, name, utils.trailing_slash()),
                        self.wrap_view("dispatch_subresource"),
                        {"request_type": "list"},
                        name="api_dispatch_subresource_list",
                    ),
                    urls.url(
                        r"^(?P<resource_name>%s)/(?P<pk>\w[\w-]*)/(?P<subresource_name>%s)/(?P<subresource_pk>\w[\w-]*)%s$"
                        % (self._meta.resource_name, name, utils.trailing_slash()),
                        self.wrap_view("dispatch_subresource"),
                        {"request_type": "detail"},
                        name="api_dispatch_subresource_detail",
                    ),
                )
            )

        return embedded_urls + base
Example #26
0
    def get_subpage_urls(self):
        programme_count = len(self.get_programmes())

        if programme_count == 0:
            return [
                url(r"^$", self.serve_landing, name="landing"),
                url(r"^schools/$", self.serve_school_index, name="school_index"),
                url(r"^(?P<school>[\w\-]+)/$", self.serve_school, name="school"),
                url(r"^(?P<school>[\w\-]+)/(?P<programme>[\w\-]+)/$", self.serve_programme, name="programme"),
                url(
                    r"^(?P<school>[\w\-]+)/(?P<programme>[\w\-]+)/(?P<slug>[\w\-]+)/$",
                    self.serve_student,
                    name="student",
                ),
            ]
        elif programme_count == 1:
            programme = self.programmes.all()[0].programme

            return [
                url(r"^$", self.serve_programme, dict(programme=programme, school=None), name="programme"),
                url(
                    r"^(?P<slug>[\w\-]+)/$", self.serve_student, dict(programme=programme, school=None), name="student"
                ),
            ]
        else:
            return [
                url(r"^$", self.serve_landing, name="landing"),
                url(r"^(?P<programme>[\w\-]+)/$", self.serve_programme, dict(school=None), name="programme"),
                url(r"^(?P<programme>[\w\-]+)/(?P<slug>.+)/$", self.serve_student, dict(school=None), name="student"),
            ]
Example #27
0
def redirect_urls(model_admin, url_type):
    """change the url redirection."""
    from django.conf.urls import patterns, url
    from functools import update_wrapper

    def wrap(view):
        """wrap the view fuction."""

        def wrapper(*args, **kwargs):
            """return the wrapper."""
            return model_admin.admin_site.admin_view(view)(*args, **kwargs)

        return update_wrapper(wrapper, view)

    info = model_admin.model._meta.app_label, model_admin.model._meta.module_name
    urlpatterns = patterns(
        "",
        url(
            r"^$",
            wrap(library_action_admin_list if url_type == "changelist" else model_admin.changelist_view),
            name="%s_%s_changelist" % info,
        ),
        url(r"^add/$", wrap(model_admin.add_view), name="%s_%s_add" % info),
        url(r"^(.+)/history/$", wrap(model_admin.history_view), name="%s_%s_history" % info),
        url(r"^(.+)/delete/$", wrap(model_admin.delete_view), name="%s_%s_delete" % info),
        url(
            r"^(.+)/$",
            wrap(library_action_admin if url_type == "change" else model_admin.change_view),
            name="%s_%s_change" % info,
        ),
    )
    return urlpatterns
Example #28
0
 def base_urls(self):
     """
     The standard URLs this ``Resource`` should respond to.
     """
     # Due to the way Django parses URLs, ``get_multiple`` won't work without
     # a trailing slash.
     # removed trailing slash for resource
     return [
         url(
             r"^(?P<resource_name>%s)$" % (self._meta.resource_name),
             self.wrap_view("dispatch_list"),
             name="api_dispatch_list",
         ),
         url(
             r"^(?P<resource_name>%s)/schema$" % (self._meta.resource_name),
             self.wrap_view("get_schema"),
             name="api_get_schema",
         ),
         url(
             r"^(?P<resource_name>%s)/set/(?P<pk_list>\w[\w/;-]*)/$" % self._meta.resource_name,
             self.wrap_view("get_multiple"),
             name="api_get_multiple",
         ),
         url(
             r"^(?P<resource_name>%s)/(?P<pk>\w[\w/-]*)$" % (self._meta.resource_name),
             self.wrap_view("dispatch_detail"),
             name="api_dispatch_detail",
         ),
     ]
Example #29
0
    def get_urls(self):
        try:
            # django >=1.4
            from django.conf.urls import patterns, url
        except ImportError:
            # django <1.4
            from django.conf.urls.defaults import patterns, url
        urls = super(ClipboardAdmin, self).get_urls()
        from filer import views

        url_patterns = patterns(
            "",
            url(
                r"^operations/paste_clipboard_to_folder/$",
                self.admin_site.admin_view(views.paste_clipboard_to_folder),
                name="filer-paste_clipboard_to_folder",
            ),
            url(
                r"^operations/discard_clipboard/$",
                self.admin_site.admin_view(views.discard_clipboard),
                name="filer-discard_clipboard",
            ),
            url(
                r"^operations/delete_clipboard/$",
                self.admin_site.admin_view(views.delete_clipboard),
                name="filer-delete_clipboard",
            ),
            # upload does it's own permission stuff (because of the stupid
            # flash missing cookie stuff)
            url(r"^operations/upload/$", self.ajax_upload, name="filer-ajax_upload"),
        )
        url_patterns.extend(urls)
        return url_patterns
Example #30
0
 def get_urls(self):
     return [
         url(_(r"^mark/forums/$"), self.mark_forums_read_view.as_view(), name="mark_all_forums_read"),
         url(_(r"^mark/forums/(?P<pk>\d+)/$"), self.mark_forums_read_view.as_view(), name="mark_subforums_read"),
         url(_(r"^mark/forum/(?P<pk>\d+)/topics/$"), self.mark_topics_read_view.as_view(), name="mark_topics_read"),
         url(_(r"^unread-topics/$"), self.unread_topics_view.as_view(), name="unread_topics"),
     ]