Rename tixl to pretix

This commit is contained in:
Raphael Michel
2015-01-19 01:10:35 +01:00
parent fd93dcae3c
commit 6648e7ed03
107 changed files with 524 additions and 529 deletions
Binary file not shown.
+15 -15
View File
@@ -4,18 +4,18 @@
Plugin basics
=============
It is possible to extend tixl with custom Python code using the official plugin
It is possible to extend pretix with custom Python code using the official plugin
API. Every plugin has to be implemented as an independent Django 'app' living
either in an own python package either installed like any python module or in
the ``tixlplugins/`` directory of your tixl installation. A plugin may only
the ``pretixplugins/`` directory of your pretix installation. A plugin may only
require two steps to install:
* Add it to the ``INSTALLED_APPS`` setting of Django in ``tixl/settings.py``
* Add it to the ``INSTALLED_APPS`` setting of Django in ``pretix/settings.py``
* Perform database migrations by using ``python manage.py migrate``
The communication between tixl and the plugins happens via Django's
`signal dispatcher`_ pattern. The core modules of tixl, ``tixlbase``,
``tixlcontrol`` and ``tixlpresale`` expose a number of signals which are documented
The communication between pretix and the plugins happens via Django's
`signal dispatcher`_ pattern. The core modules of pretix, ``pretixbase``,
``pretixcontrol`` and ``pretixpresale`` expose a number of signals which are documented
on the next pages.
.. _`pluginsetup`:
@@ -23,15 +23,15 @@ on the next pages.
Creating a plugin
-----------------
To create a new plugin, create a new python package as a subpackage to ``tixlplugins``.
In order to do so, you can place your module into tixl's :file:`tixlplugins` folder *or
anywhere else in your python import path* inside a folder called ``tixlplugins``.
To create a new plugin, create a new python package as a subpackage to ``pretixplugins``.
In order to do so, you can place your module into pretix's :file:`pretixplugins` folder *or
anywhere else in your python import path* inside a folder called ``pretixplugins``.
.. IMPORTANT::
This makes use of a design pattern called `namespace packages`_ which is only
implicitly available as of Python 3.4. As we aim to support Python 3.2 for a bit
longer, you **MUST** put **EXACLTY** the following content into ``tixlplugins/__init__.py``
if you create a new ``tixlplugins`` folder somewhere in your path::
longer, you **MUST** put **EXACLTY** the following content into ``pretixplugins/__init__.py``
if you create a new ``pretixplugins`` folder somewhere in your path::
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
@@ -48,17 +48,17 @@ example, taken from the time restriction module (see next chapter) as a template
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from tixlbase.plugins import PluginType
from pretixbase.plugins import PluginType
class TimeRestrictionApp(AppConfig):
name = 'tixlplugins.timerestriction'
name = 'pretixplugins.timerestriction'
verbose_name = _("Time restriction")
class TixlPluginMeta:
type = PluginType.RESTRICTION
name = _("Restriciton by time")
author = _("the tixl team")
author = _("the pretix 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 " +
@@ -67,7 +67,7 @@ example, taken from the time restriction module (see next chapter) as a template
def ready(self):
from . import signals # NOQA
default_app_config = 'tixlplugins.timerestriction.TimeRestrictionApp'
default_app_config = 'pretixplugins.timerestriction.TimeRestrictionApp'
.. IMPORTANT::
You have to implement a ``TixlPluginMeta`` class like in the example to make your
+14 -14
View File
@@ -4,7 +4,7 @@
Writing a restriction plugin
============================
Please make sure you have read and understood the :ref:`basic idea being tixl's restrictions
Please make sure you have read and understood the :ref:`basic idea being pretix's restrictions
<restrictionconcept>`. In this document, we will walk through the creation of a restriction
plugin using the example of a restriction by date and time.
@@ -15,14 +15,14 @@ The restriction model
It is very likely that your new restriction plugin needs to store data. In order to do
so, it should define its own model with a name related to what your restriction does,
e.g. ``TimeRestriction``. This model should be a child class of ``tixlbase.models.BaseRestriction``.
e.g. ``TimeRestriction``. This model should be a child class of ``pretixbase.models.BaseRestriction``.
You do not need to define custom fields, but you should create at least an empty model.
In our example, we put the following into :file:`tixlplugins/timerestriction/models.py`::
In our example, we put the following into :file:`pretixplugins/timerestriction/models.py`::
from django.db import models
from django.utils.translation import ugettext_lazy as _
from tixlbase.models import BaseRestriction
from pretixbase.models import BaseRestriction
class TimeRestriction(BaseRestriction):
@@ -52,14 +52,14 @@ Availability determination
^^^^^^^^^^^^^^^^^^^^^^^^^^
This is the one signal *every* restriction plugin has to listen for, as your plugin does not
restrict anything without doing so. It is available as ``tixlbase.signals.determine_availability``
and is sent out every time some component of tixl wants to know whether a specific item or
restrict anything without doing so. It is available as ``pretixbase.signals.determine_availability``
and is sent out every time some component of pretix wants to know whether a specific item or
variation is available for sell.
It is sent out with several keyword arguments:
``item``
The instance of ``tixlbase.models.Item`` in question.
The instance of ``pretixbase.models.Item`` in question.
``variations``
A list of dictionaries in the same format as ``Item.get_all_variations``:
The list contains one dictionary per variation, where the ``Property`` IDs are
@@ -68,7 +68,7 @@ It is sent out with several keyword arguments:
the item does not have any properties, the list will contain exactly one empty
dictionary. Please note: this is *not* the list of all possible variations, this is
only the list of all variations the frontend likes to determine the status for.
Technically, you won't get ``dict`` objects but ``tixlbase.types.VariationDict``
Technically, you won't get ``dict`` objects but ``pretixbase.types.VariationDict``
objects, which behave exactly the same but add some extra methods.
``context``
A yet-to-be-defined context object containing information about the user and the order
@@ -103,7 +103,7 @@ In our example, the implementation could look like this::
from django.dispatch import receiver
from django.utils.timezone import now
from tixlbase.signals import determine_availability
from pretixbase.signals import determine_availability
from .models import TimeRestriction
@@ -217,12 +217,12 @@ Control interface formsets
To make it possible for the event organizer to configure your restriction, there is a
'Restrictions' page in the item configuration. This page is able to show a formset for
each restriction plugin, but *you* are required to create this formset. This is why you
should listen to the the ``tixlcontrol.signals.restriction_formset`` signal.
should listen to the the ``pretixcontrol.signals.restriction_formset`` signal.
Currently, the signal comes with only one keyword argument:
``item``
The instance of ``tixlbase.models.Item`` we want a formset for.
The instance of ``pretixbase.models.Item`` we want a formset for.
You are expected to return a dict containing the following items:
@@ -245,9 +245,9 @@ Our time restriction example looks like this::
from django.dispatch import receiver
from django.forms.models import inlineformset_factory
from tixlcontrol.signals import restriction_formset
from tixlbase.models import Item
from tixlcontrol.views.forms import (
from pretixcontrol.signals import restriction_formset
from pretixbase.models import Item
from pretixcontrol.views.forms import (
VariationsField, RestrictionInlineFormset, RestrictionForm
)