2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-28 13:46:54 +00:00
Matthias Mair a55a68d629
Update metadata
Closes #282
2022-05-25 22:30:33 +02:00

776 B

title
title
URLs Mixin

UrlsMixin

Use the class constant URLS for a array of URLs that should be added to InvenTrees URL paths or override the plugin.setup_urls function.

The array has to contain valid URL patterns as defined in the django documentation.

class MyUrlsPlugin(URLsMixin, InvenTreePlugin):

    NAME = "UrlsMixin"

    URLS = [
        url(r'increase/(?P<location>\d+)/(?P<pk>\d+)/', self.view_increase, name='increase-level'),
    ]

The URLs get exposed under /plugin/{plugin.slug}/* and get exposed to the template engine with the prefix plugin:{plugin.slug}: (for usage with the url tag).