forked from CGM_Public/pretix_original
Plugin registry
This commit is contained in:
@@ -47,17 +47,31 @@ example, taken from the time restriction module (see next chapter) as a template
|
||||
``__init__.py`` module::
|
||||
|
||||
from django.apps import AppConfig
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from tixlbase.plugins import PluginType
|
||||
|
||||
|
||||
class TimeRestrictionApp(AppConfig):
|
||||
name = 'tixlplugins.timerestriction'
|
||||
verbose_name = "Time restriction"
|
||||
verbose_name = _("Time restriction")
|
||||
|
||||
class TixlPluginMeta:
|
||||
type = PluginType.RESTRICTION
|
||||
name = _("Restriciton by time")
|
||||
author = _("the tixl team")
|
||||
version = '1.0.0'
|
||||
description = _("This plugin adds the possibility to restrict the sale " +
|
||||
"of a given item or variation to a certain timeframe " +
|
||||
"or change its price during a certain period.")
|
||||
|
||||
def ready(self):
|
||||
from . import signals
|
||||
from . import signals # NOQA
|
||||
|
||||
default_app_config = 'tixlplugins.timerestriction.TimeRestrictionApp'
|
||||
|
||||
.. IMPORTANT::
|
||||
You have to implement a ``TixlPluginMeta`` class like in the example to make your
|
||||
plugin available to the users.
|
||||
|
||||
.. _signal dispatcher: https://docs.djangoproject.com/en/1.7/topics/signals/
|
||||
.. _namespace packages: http://legacy.python.org/dev/peps/pep-0420/
|
||||
|
||||
Reference in New Issue
Block a user