mirror of
https://github.com/pretix/pretix.git
synced 2026-04-23 23:22:32 +00:00
Rename tixl to pretix
This commit is contained in:
8
.gitmodules
vendored
8
.gitmodules
vendored
@@ -1,6 +1,6 @@
|
||||
[submodule "src/tixlbase/static/bootstrap"]
|
||||
path = src/tixlbase/static/bootstrap
|
||||
[submodule "src/pretixbase/static/bootstrap"]
|
||||
path = src/pretixbase/static/bootstrap
|
||||
url = https://github.com/twbs/bootstrap.git
|
||||
[submodule "src/tixlbase/static/fontawesome"]
|
||||
path = src/tixlbase/static/fontawesome
|
||||
[submodule "src/pretixbase/static/fontawesome"]
|
||||
path = src/pretixbase/static/fontawesome
|
||||
url = https://github.com/FortAwesome/Font-Awesome.git
|
||||
|
||||
10
README.md
10
README.md
@@ -1,9 +1,9 @@
|
||||
tixl
|
||||
====
|
||||
pretix
|
||||
======
|
||||
|
||||
[](https://readthedocs.org/projects/tixl/)
|
||||
[](https://travis-ci.org/tixl/tixl)
|
||||
[](https://coveralls.io/r/tixl/tixl)
|
||||
[](https://readthedocs.org/projects/pretix/)
|
||||
[](https://travis-ci.org/pretix/pretix)
|
||||
[](https://coveralls.io/r/pretix/pretix)
|
||||
|
||||
|
||||
Reinventing ticket presales, one bit at a time.
|
||||
|
||||
@@ -85,17 +85,17 @@ qthelp:
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/tixl.qhcp"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pretix.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/tixl.qhc"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pretix.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/tixl"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/tixl"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/pretix"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pretix"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
|
||||
14
doc/conf.py
14
doc/conf.py
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# tixl documentation build configuration file, created by
|
||||
# pretix documentation build configuration file, created by
|
||||
# sphinx-quickstart on Mon Sep 8 15:13:08 2014.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
@@ -49,7 +49,7 @@ source_suffix = '.rst'
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = 'tixl'
|
||||
project = 'pretix'
|
||||
copyright = '2014, Raphael Michel'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
@@ -182,7 +182,7 @@ html_use_index = False
|
||||
#html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'tixldoc'
|
||||
htmlhelp_basename = 'pretixdoc'
|
||||
|
||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||
if not on_rtd: # only import and set the theme if we're building docs locally
|
||||
@@ -208,7 +208,7 @@ latex_elements = {
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
('index', 'tixl.tex', 'tixl Documentation',
|
||||
('index', 'pretix.tex', 'pretix Documentation',
|
||||
'Raphael Michel', 'manual'),
|
||||
]
|
||||
|
||||
@@ -238,7 +238,7 @@ latex_documents = [
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'tixl', 'tixl Documentation',
|
||||
('index', 'pretix', 'pretix Documentation',
|
||||
['Raphael Michel'], 1)
|
||||
]
|
||||
|
||||
@@ -252,8 +252,8 @@ man_pages = [
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'tixl', 'tixl Documentation',
|
||||
'Raphael Michel', 'tixl', 'One line description of project.',
|
||||
('index', 'pretix', 'pretix Documentation',
|
||||
'Raphael Michel', 'pretix', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
|
||||
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -7,18 +7,18 @@ Basic terminology
|
||||
The components
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
The project tixl is split into several components. The main three of them are:
|
||||
The project pretix is split into several components. The main three of them are:
|
||||
|
||||
**tixlbase**
|
||||
**pretixbase**
|
||||
Tixlbase is the foundation below all other components. It is primarily
|
||||
responsible for the data structures and database communication. It also hosts
|
||||
several utilities which are used by multiple other components.
|
||||
|
||||
**tixlcontrol**
|
||||
**pretixcontrol**
|
||||
Tixlcontrol is the web-based backend software which allows organizers to
|
||||
create and manage their events, items, orders and tickets.
|
||||
|
||||
**tixlpresale**
|
||||
**pretixpresale**
|
||||
Tixlpresale is the ticket-shop itself, containing all the parts visible to the
|
||||
end user.
|
||||
|
||||
@@ -29,7 +29,7 @@ Tixl is all about **events**, which are defined as something happening somewhere
|
||||
Every Event is managed by the **organizer**, an abstract entity running the event.
|
||||
|
||||
Tixl is used by **users**. We want to enable global users who can just login into
|
||||
tixl and buy tickets for as many events as they like but at the same time it
|
||||
pretix and buy tickets for as many events as they like but at the same time it
|
||||
should be possible to create some kind of local user to have a temporary account
|
||||
just to buy tickets for one single event.
|
||||
|
||||
@@ -46,7 +46,7 @@ as our primary key:
|
||||
**Local users**
|
||||
Local users do only exist inside the scope of one event. They are identified by
|
||||
usernames, which are only valid for exactly one event. Internally, their identifier
|
||||
is "{username}@{event.id}.event.tixl"
|
||||
is "{username}@{event.id}.event.pretix"
|
||||
|
||||
**Global users**
|
||||
Global users exist everywhere in the installation of Tixl. They can buy tickets
|
||||
@@ -57,7 +57,7 @@ as our primary key:
|
||||
Items and variations
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The purpose of tixl is to sell **items** (which belong to **events**) to **users**.
|
||||
The purpose of pretix is to sell **items** (which belong to **events**) to **users**.
|
||||
An **item** is a abstract thing, popular examples being event tickets or a piece of
|
||||
merchandise, like 'T-Shirt'. An **item** can have multiple **properties** with multiple
|
||||
**values** each. For example, the **item** 'T-Shirt' could have the **property** 'Size'
|
||||
@@ -79,7 +79,7 @@ include 'Name' or 'age'.
|
||||
Restrictions
|
||||
^^^^^^^^^^^^
|
||||
|
||||
The probably most powerful concepts of tixl is the very abstract concept of **restricitons**.
|
||||
The probably most powerful concepts of pretix is the very abstract concept of **restricitons**.
|
||||
We already know that **items** can come in very different **variations**, but a
|
||||
**restriction** decides whether an variation is available for sale and assign **prices**
|
||||
to **variations**. There are **restriction types** (pieces of code implementing the
|
||||
@@ -115,7 +115,7 @@ Any number of **restrictions** can be applied to the whole of a **item** or even
|
||||
sense otherwise on an one-dimensional time axis).
|
||||
* If multiple restrictions apply which set the price, the *cheapest* price determines the final price.
|
||||
|
||||
Restrictions can be implemented using a plugin system and do not require changes to the tixl codebase.
|
||||
Restrictions can be implemented using a plugin system and do not require changes to the pretix codebase.
|
||||
|
||||
Restriction by number
|
||||
"""""""""""""""""""""
|
||||
|
||||
@@ -17,7 +17,7 @@ Technical goals
|
||||
Feature goals
|
||||
-------------
|
||||
|
||||
* One tixl software installation has to cope with multiple events by multiple organizers
|
||||
* One pretix software installation has to cope with multiple events by multiple organizers
|
||||
* There is no code access necessary to create a new event
|
||||
* Tixl is abstract in many ways to adopt to as much events as possible.
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ Obtain a copy of the source code
|
||||
--------------------------------
|
||||
Just clone our git repository including its submodules::
|
||||
|
||||
git clone --recursive https://github.com/tixl/tixl.git
|
||||
cd tixl/
|
||||
git clone --recursive https://github.com/pretix/pretix.git
|
||||
cd pretix/
|
||||
|
||||
External Dependencies
|
||||
---------------------
|
||||
@@ -27,7 +27,7 @@ environment and activate it for your current session::
|
||||
source env/bin/activate
|
||||
|
||||
You should now see a ``(env)`` prepended to your shell prompt. You have to do this
|
||||
in every shell you use to work with tixl (or configure your shell to do so
|
||||
in every shell you use to work with pretix (or configure your shell to do so
|
||||
automatically).
|
||||
|
||||
Working with the code
|
||||
@@ -48,7 +48,7 @@ source code for strings to be translated and update the ``*.po`` files according
|
||||
|
||||
make localegen
|
||||
|
||||
To actually see tixl in your language, you have to compile the ``*.po`` files to their
|
||||
To actually see pretix in your language, you have to compile the ``*.po`` files to their
|
||||
optimized binary ``*.mo`` counterparts::
|
||||
|
||||
make localecompile
|
||||
|
||||
@@ -6,17 +6,17 @@ Python source code
|
||||
|
||||
All the source code lives in ``src/``, which has several subdirectories.
|
||||
|
||||
tixl/
|
||||
pretix/
|
||||
This directory contains the basic Django settings and URL routing.
|
||||
|
||||
tixlbase/
|
||||
pretixbase/
|
||||
This is the django app containing all the models and methods which are
|
||||
essential to all of tixl's features.
|
||||
essential to all of pretix's features.
|
||||
|
||||
tixlcontrol/
|
||||
pretixcontrol/
|
||||
This is the django app containing the frontend for organizers.
|
||||
|
||||
tixlpresale/
|
||||
pretixpresale/
|
||||
This is the django app containing the frontend for users buying tickets.
|
||||
|
||||
helpers/
|
||||
@@ -37,24 +37,24 @@ LESS source code
|
||||
We use less as a preprocessor for CSS. Our own less code is built in the same
|
||||
step as Bootstrap and FontAwesome, so their mixins etc. are fully available.
|
||||
|
||||
tixlcontrol
|
||||
tixlcontrol has two main LESS files, ``tixlcontrol/static/tixlcontrol/less/main.less`` and
|
||||
``tixlcontrol/static/tixlcontrol/less/auth.less``, importing everything else.
|
||||
pretixcontrol
|
||||
pretixcontrol has two main LESS files, ``pretixcontrol/static/pretixcontrol/less/main.less`` and
|
||||
``pretixcontrol/static/pretixcontrol/less/auth.less``, importing everything else.
|
||||
|
||||
3rd-party assets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Bootstrap
|
||||
Bootstrap lives as a git submodule at ``tixlbase/static/bootstrap/``
|
||||
Bootstrap lives as a git submodule at ``pretixbase/static/bootstrap/``
|
||||
|
||||
Font Awesome
|
||||
Font Awesome lives as a git submodule at ``tixlbase/static/fontawesome/``
|
||||
Font Awesome lives as a git submodule at ``pretixbase/static/fontawesome/``
|
||||
|
||||
jQuery
|
||||
jQuery lives as a single JavaScript file in ``tixlbase/static/jquery/js/``
|
||||
jQuery lives as a single JavaScript file in ``pretixbase/static/jquery/js/``
|
||||
|
||||
jQuery plugin: Django formsets
|
||||
Our own modified version of `django-formset-js`_ is available as an independent
|
||||
django app and installed via pip.
|
||||
|
||||
.. _django-formset-js: https://github.com/tixl/django-formset-js
|
||||
.. _django-formset-js: https://github.com/pretix/django-formset-js
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
.. tixl documentation master file, created by
|
||||
.. pretix documentation master file, created by
|
||||
sphinx-quickstart on Mon Sep 8 15:13:08 2014.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to tixl's documentation!
|
||||
Welcome to pretix's documentation!
|
||||
================================
|
||||
|
||||
Contents:
|
||||
|
||||
@@ -115,9 +115,9 @@ if "%1" == "qthelp" (
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\tixl.qhcp
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\pretix.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\tixl.ghc
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\pretix.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[run]
|
||||
source = tixlbase,tixlcontrol,tixlpresale,tixlplugins
|
||||
source = pretixbase,pretixcontrol,pretixpresale,pretixplugins
|
||||
omit = */migrations/*,*/urls.py,*/tests/*
|
||||
|
||||
[report]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ import os
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tixl.settings")
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pretix.settings")
|
||||
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
Django settings for tixl project.
|
||||
Django settings for pretix project.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/dev/topics/settings/
|
||||
@@ -37,15 +37,15 @@ INSTALLED_APPS = (
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'tixlbase',
|
||||
'tixlcontrol',
|
||||
'tixlpresale',
|
||||
'pretixbase',
|
||||
'pretixcontrol',
|
||||
'pretixpresale',
|
||||
'compressor',
|
||||
'bootstrap3',
|
||||
'debug_toolbar.apps.DebugToolbarConfig',
|
||||
'djangoformsetjs',
|
||||
'tixlplugins.testdummy',
|
||||
'tixlplugins.timerestriction',
|
||||
'pretixplugins.testdummy',
|
||||
'pretixplugins.timerestriction',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
@@ -55,10 +55,10 @@ MIDDLEWARE_CLASSES = (
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
|
||||
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||
'tixlbase.middleware.LocaleMiddleware',
|
||||
'pretixbase.middleware.LocaleMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
'tixlcontrol.middleware.PermissionMiddleware',
|
||||
'pretixcontrol.middleware.PermissionMiddleware',
|
||||
)
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
@@ -70,12 +70,12 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
"django.core.context_processors.static",
|
||||
"django.core.context_processors.tz",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
'tixlcontrol.context.contextprocessor',
|
||||
'pretixcontrol.context.contextprocessor',
|
||||
)
|
||||
|
||||
ROOT_URLCONF = 'tixl.urls'
|
||||
ROOT_URLCONF = 'pretix.urls'
|
||||
|
||||
WSGI_APPLICATION = 'tixl.wsgi.application'
|
||||
WSGI_APPLICATION = 'pretix.wsgi.application'
|
||||
|
||||
|
||||
# Database
|
||||
@@ -114,7 +114,7 @@ LANGUAGES = (
|
||||
|
||||
# Authentication
|
||||
|
||||
AUTH_USER_MODEL = 'tixlbase.User'
|
||||
AUTH_USER_MODEL = 'pretixbase.User'
|
||||
LOGIN_URL = '/login'
|
||||
LOGIN_URL_CONTROL = '/control/login'
|
||||
|
||||
@@ -149,7 +149,7 @@ DEBUG_TOOLBAR_CONFIG = {
|
||||
|
||||
# Tixl specific settings
|
||||
|
||||
TIXL_INSTANCE_NAME = 'tixl.de'
|
||||
TIXL_INSTANCE_NAME = 'pretix.de'
|
||||
DEFAULT_CURRENCY = 'EUR'
|
||||
INTERNAL_IPS = ('127.0.0.1', '::1')
|
||||
|
||||
@@ -2,11 +2,11 @@ from django.conf.urls import patterns, include, url
|
||||
from django.contrib import admin
|
||||
from django.conf import settings
|
||||
|
||||
import tixlcontrol.urls
|
||||
import pretixcontrol.urls
|
||||
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^control/', include(tixlcontrol.urls, namespace='control')),
|
||||
url(r'^control/', include(pretixcontrol.urls, namespace='control')),
|
||||
url(r'^admin/', include(admin.site.urls)),
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
WSGI config for tixl project.
|
||||
WSGI config for pretix project.
|
||||
|
||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||
|
||||
@@ -8,7 +8,7 @@ https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tixl.settings")
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pretix.settings")
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
application = get_wsgi_application()
|
||||
@@ -3,7 +3,7 @@ from django.contrib.auth.admin import UserAdmin
|
||||
from django.utils.translation import ugettext as _
|
||||
from django import forms
|
||||
|
||||
from tixlbase.models import (
|
||||
from pretixbase.models import (
|
||||
User, Organizer, OrganizerPermission, Event, EventPermission,
|
||||
Property, PropertyValue, Item, ItemVariation, ItemCategory
|
||||
)
|
||||
@@ -3,7 +3,7 @@ import hashlib
|
||||
|
||||
from django.core.cache import caches
|
||||
|
||||
from tixlbase.models import Event
|
||||
from pretixbase.models import Event
|
||||
|
||||
|
||||
class EventRelatedCache:
|
||||
@@ -14,7 +14,7 @@ from django.utils import translation, timezone
|
||||
from collections import OrderedDict
|
||||
from django.utils.cache import patch_vary_headers
|
||||
|
||||
from tixlbase.models import Event
|
||||
from pretixbase.models import Event
|
||||
|
||||
_supported = None
|
||||
|
||||
@@ -7,7 +7,7 @@ import django.core.validators
|
||||
from django.conf import settings
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
import tixlbase.models
|
||||
import pretixbase.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -96,7 +96,7 @@ class Migration(migrations.Migration):
|
||||
('version_birth_date', models.DateTimeField()),
|
||||
('can_change_settings', models.BooleanField(default=True, verbose_name='Can change event settings')),
|
||||
('can_change_items', models.BooleanField(default=True, verbose_name='Can change item settings')),
|
||||
('event', versions.models.VersionedForeignKey(to='tixlbase.Event')),
|
||||
('event', versions.models.VersionedForeignKey(to='pretixbase.Event')),
|
||||
('user', models.ForeignKey(related_name='event_perms', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
@@ -137,7 +137,7 @@ class Migration(migrations.Migration):
|
||||
('version_birth_date', models.DateTimeField()),
|
||||
('name', models.CharField(max_length=255, verbose_name='Category name')),
|
||||
('position', models.IntegerField(default=0)),
|
||||
('event', versions.models.VersionedForeignKey(related_name='categories', to='tixlbase.Event')),
|
||||
('event', versions.models.VersionedForeignKey(related_name='categories', to='pretixbase.Event')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Item categories',
|
||||
@@ -156,7 +156,7 @@ class Migration(migrations.Migration):
|
||||
('version_birth_date', models.DateTimeField()),
|
||||
('active', models.BooleanField(default=True, verbose_name='Active')),
|
||||
('default_price', models.DecimalField(decimal_places=2, max_digits=7, blank=True, null=True, verbose_name='Default price')),
|
||||
('item', versions.models.VersionedForeignKey(related_name='variations', to='tixlbase.Item')),
|
||||
('item', versions.models.VersionedForeignKey(related_name='variations', to='pretixbase.Item')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Item variations',
|
||||
@@ -178,7 +178,7 @@ class Migration(migrations.Migration):
|
||||
('payment_date', models.DateTimeField(verbose_name='Payment date')),
|
||||
('payment_info', models.TextField(verbose_name='Payment information')),
|
||||
('total', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Total amount')),
|
||||
('event', versions.models.VersionedForeignKey(verbose_name='Event', to='tixlbase.Event')),
|
||||
('event', versions.models.VersionedForeignKey(verbose_name='Event', to='pretixbase.Event')),
|
||||
('user', models.ForeignKey(null=True, verbose_name='User', blank=True, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
@@ -226,7 +226,7 @@ class Migration(migrations.Migration):
|
||||
('version_end_date', models.DateTimeField(blank=True, null=True, default=None)),
|
||||
('version_birth_date', models.DateTimeField()),
|
||||
('can_create_events', models.BooleanField(default=True, verbose_name='Can create events')),
|
||||
('organizer', versions.models.VersionedForeignKey(to='tixlbase.Organizer')),
|
||||
('organizer', versions.models.VersionedForeignKey(to='pretixbase.Organizer')),
|
||||
('user', models.ForeignKey(related_name='organizer_perms', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
@@ -244,7 +244,7 @@ class Migration(migrations.Migration):
|
||||
('version_end_date', models.DateTimeField(blank=True, null=True, default=None)),
|
||||
('version_birth_date', models.DateTimeField()),
|
||||
('name', models.CharField(max_length=250, verbose_name='Property name')),
|
||||
('event', versions.models.VersionedForeignKey(related_name='properties', to='tixlbase.Event')),
|
||||
('event', versions.models.VersionedForeignKey(related_name='properties', to='pretixbase.Event')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Item properties',
|
||||
@@ -262,7 +262,7 @@ class Migration(migrations.Migration):
|
||||
('version_birth_date', models.DateTimeField()),
|
||||
('value', models.CharField(max_length=250, verbose_name='Value')),
|
||||
('position', models.IntegerField(default=0)),
|
||||
('prop', versions.models.VersionedForeignKey(related_name='values', to='tixlbase.Property')),
|
||||
('prop', versions.models.VersionedForeignKey(related_name='values', to='pretixbase.Property')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Property values',
|
||||
@@ -282,7 +282,7 @@ class Migration(migrations.Migration):
|
||||
('question', models.TextField(verbose_name='Question')),
|
||||
('type', models.CharField(max_length=5, choices=[('N', 'Number'), ('S', 'Text (one line)'), ('T', 'Multiline text'), ('B', 'Yes/No')], verbose_name='Question type')),
|
||||
('required', models.BooleanField(default=False, verbose_name='Required question')),
|
||||
('event', versions.models.VersionedForeignKey(related_name='questions', to='tixlbase.Event')),
|
||||
('event', versions.models.VersionedForeignKey(related_name='questions', to='pretixbase.Event')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Questions',
|
||||
@@ -299,9 +299,9 @@ class Migration(migrations.Migration):
|
||||
('version_end_date', models.DateTimeField(blank=True, null=True, default=None)),
|
||||
('version_birth_date', models.DateTimeField()),
|
||||
('answer', models.TextField()),
|
||||
('cartposition', models.ForeignKey(null=True, to='tixlbase.CartPosition', blank=True)),
|
||||
('orderposition', models.ForeignKey(null=True, to='tixlbase.OrderPosition', blank=True)),
|
||||
('question', versions.models.VersionedForeignKey(to='tixlbase.Question')),
|
||||
('cartposition', models.ForeignKey(null=True, to='pretixbase.CartPosition', blank=True)),
|
||||
('orderposition', models.ForeignKey(null=True, to='pretixbase.OrderPosition', blank=True)),
|
||||
('question', versions.models.VersionedForeignKey(to='pretixbase.Question')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
@@ -318,11 +318,11 @@ class Migration(migrations.Migration):
|
||||
('version_birth_date', models.DateTimeField()),
|
||||
('name', models.CharField(max_length=200, verbose_name='Name')),
|
||||
('size', models.PositiveIntegerField(verbose_name='Total capacity')),
|
||||
('event', versions.models.VersionedForeignKey(related_name='quotas', to='tixlbase.Event', verbose_name='Event')),
|
||||
('items', versions.models.VersionedManyToManyField(blank=True, to='tixlbase.Item', verbose_name='Item')),
|
||||
('lock_cache', models.ManyToManyField(blank=True, to='tixlbase.CartPosition')),
|
||||
('order_cache', models.ManyToManyField(blank=True, to='tixlbase.OrderPosition')),
|
||||
('variations', tixlbase.models.VariationsField(blank=True, to='tixlbase.ItemVariation', verbose_name='Variations')),
|
||||
('event', versions.models.VersionedForeignKey(related_name='quotas', to='pretixbase.Event', verbose_name='Event')),
|
||||
('items', versions.models.VersionedManyToManyField(blank=True, to='pretixbase.Item', verbose_name='Item')),
|
||||
('lock_cache', models.ManyToManyField(blank=True, to='pretixbase.CartPosition')),
|
||||
('order_cache', models.ManyToManyField(blank=True, to='pretixbase.OrderPosition')),
|
||||
('variations', pretixbase.models.VariationsField(blank=True, to='pretixbase.ItemVariation', verbose_name='Variations')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Quotas',
|
||||
@@ -337,85 +337,85 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='organizer',
|
||||
name='permitted',
|
||||
field=models.ManyToManyField(through='tixlbase.OrganizerPermission', related_name='organizers', to=settings.AUTH_USER_MODEL),
|
||||
field=models.ManyToManyField(through='pretixbase.OrganizerPermission', related_name='organizers', to=settings.AUTH_USER_MODEL),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='orderposition',
|
||||
name='answers',
|
||||
field=versions.models.VersionedManyToManyField(through='tixlbase.QuestionAnswer', to='tixlbase.Question', verbose_name='Answers'),
|
||||
field=versions.models.VersionedManyToManyField(through='pretixbase.QuestionAnswer', to='pretixbase.Question', verbose_name='Answers'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='orderposition',
|
||||
name='item',
|
||||
field=versions.models.VersionedForeignKey(verbose_name='Item', to='tixlbase.Item'),
|
||||
field=versions.models.VersionedForeignKey(verbose_name='Item', to='pretixbase.Item'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='orderposition',
|
||||
name='order',
|
||||
field=versions.models.VersionedForeignKey(verbose_name='Order', to='tixlbase.Order'),
|
||||
field=versions.models.VersionedForeignKey(verbose_name='Order', to='pretixbase.Order'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='orderposition',
|
||||
name='variation',
|
||||
field=versions.models.VersionedForeignKey(null=True, verbose_name='Variation', blank=True, to='tixlbase.ItemVariation'),
|
||||
field=versions.models.VersionedForeignKey(null=True, verbose_name='Variation', blank=True, to='pretixbase.ItemVariation'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='itemvariation',
|
||||
name='values',
|
||||
field=versions.models.VersionedManyToManyField(related_name='variations', to='tixlbase.PropertyValue'),
|
||||
field=versions.models.VersionedManyToManyField(related_name='variations', to='pretixbase.PropertyValue'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='item',
|
||||
name='category',
|
||||
field=versions.models.VersionedForeignKey(on_delete=django.db.models.deletion.PROTECT, null=True, related_name='items', verbose_name='Category', blank=True, to='tixlbase.ItemCategory'),
|
||||
field=versions.models.VersionedForeignKey(on_delete=django.db.models.deletion.PROTECT, null=True, related_name='items', verbose_name='Category', blank=True, to='pretixbase.ItemCategory'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='item',
|
||||
name='event',
|
||||
field=versions.models.VersionedForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='items', to='tixlbase.Event', verbose_name='Event'),
|
||||
field=versions.models.VersionedForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='items', to='pretixbase.Event', verbose_name='Event'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='item',
|
||||
name='properties',
|
||||
field=versions.models.VersionedManyToManyField(blank=True, related_name='items', help_text="The selected properties will be available for the user to select. After saving this field, move to the 'Variations' tab to configure the details.", verbose_name='Properties', to='tixlbase.Property'),
|
||||
field=versions.models.VersionedManyToManyField(blank=True, related_name='items', help_text="The selected properties will be available for the user to select. After saving this field, move to the 'Variations' tab to configure the details.", verbose_name='Properties', to='pretixbase.Property'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='item',
|
||||
name='questions',
|
||||
field=versions.models.VersionedManyToManyField(blank=True, related_name='items', help_text='The user will be asked to fill in answers for the selected questions', verbose_name='Questions', to='tixlbase.Question'),
|
||||
field=versions.models.VersionedManyToManyField(blank=True, related_name='items', help_text='The user will be asked to fill in answers for the selected questions', verbose_name='Questions', to='pretixbase.Question'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='event',
|
||||
name='organizer',
|
||||
field=versions.models.VersionedForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='events', to='tixlbase.Organizer'),
|
||||
field=versions.models.VersionedForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='events', to='pretixbase.Organizer'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='event',
|
||||
name='permitted',
|
||||
field=models.ManyToManyField(through='tixlbase.EventPermission', related_name='events', to=settings.AUTH_USER_MODEL),
|
||||
field=models.ManyToManyField(through='pretixbase.EventPermission', related_name='events', to=settings.AUTH_USER_MODEL),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cartposition',
|
||||
name='event',
|
||||
field=versions.models.VersionedForeignKey(verbose_name='Event', to='tixlbase.Event'),
|
||||
field=versions.models.VersionedForeignKey(verbose_name='Event', to='pretixbase.Event'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cartposition',
|
||||
name='item',
|
||||
field=versions.models.VersionedForeignKey(verbose_name='Item', to='tixlbase.Item'),
|
||||
field=versions.models.VersionedForeignKey(verbose_name='Item', to='pretixbase.Item'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
@@ -427,13 +427,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='cartposition',
|
||||
name='variation',
|
||||
field=versions.models.VersionedForeignKey(null=True, verbose_name='Variation', blank=True, to='tixlbase.ItemVariation'),
|
||||
field=versions.models.VersionedForeignKey(null=True, verbose_name='Variation', blank=True, to='pretixbase.ItemVariation'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='user',
|
||||
name='event',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, null=True, related_name='users', to='tixlbase.Event', blank=True),
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, null=True, related_name='users', to='pretixbase.Event', blank=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
@@ -12,7 +12,7 @@ import six
|
||||
from versions.models import Versionable as BaseVersionable
|
||||
from versions.models import VersionedForeignKey, VersionedManyToManyField, get_utc_now
|
||||
|
||||
from tixlbase.types import VariationDict
|
||||
from pretixbase.types import VariationDict
|
||||
|
||||
|
||||
class Versionable(BaseVersionable):
|
||||
@@ -95,10 +95,10 @@ class UserManager(BaseUserManager):
|
||||
|
||||
class User(AbstractBaseUser, PermissionsMixin):
|
||||
"""
|
||||
This is the user model used by tixl for authentication.
|
||||
This is the user model used by pretix for authentication.
|
||||
Handling users is somehow complicated, as we try to have two
|
||||
classes of users in one system:
|
||||
(1) We want global users who can just login into tixl and
|
||||
(1) We want global users who can just login into pretix and
|
||||
buy tickets for multiple events -- we also need those
|
||||
global users for event organizers who should not need
|
||||
multiple users for managing multiple events.
|
||||
@@ -117,7 +117,7 @@ class User(AbstractBaseUser, PermissionsMixin):
|
||||
(1) the e-mail address for global users. An e-mail address
|
||||
is and should be required for them and global users use
|
||||
their e-mail address for login.
|
||||
(2) "{username}@{event.id}.event.tixl" for local users, who
|
||||
(2) "{username}@{event.id}.event.pretix" for local users, who
|
||||
use their username to login on the event page.
|
||||
The model's save() method automatically fills the identifier field
|
||||
according to this scheme when it is empty. The __str__() method
|
||||
@@ -174,7 +174,7 @@ class User(AbstractBaseUser, PermissionsMixin):
|
||||
if self.event is None:
|
||||
self.identifier = self.email.lower()
|
||||
else:
|
||||
self.identifier = "%s@%s.event.tixl" % (self.username.lower(), self.event.id)
|
||||
self.identifier = "%s@%s.event.pretix" % (self.username.lower(), self.event.id)
|
||||
if not self.pk:
|
||||
self.identifier = self.identifier.lower()
|
||||
super().save(*args, **kwargs)
|
||||
@@ -375,8 +375,8 @@ class Event(Versionable):
|
||||
"DATETIME_FORMAT" if self.show_times else "DATE_FORMAT"
|
||||
)
|
||||
|
||||
def get_cache(self) -> "tixlbase.cache.EventRelatedCache":
|
||||
from tixlbase.cache import EventRelatedCache
|
||||
def get_cache(self) -> "pretixbase.cache.EventRelatedCache":
|
||||
from pretixbase.cache import EventRelatedCache
|
||||
return EventRelatedCache(self)
|
||||
|
||||
|
||||
@@ -758,12 +758,12 @@ class ItemVariation(Versionable):
|
||||
|
||||
class VariationsField(VersionedManyToManyField):
|
||||
"""
|
||||
This is a ManyToManyField using the tixlcontrol.views.forms.VariationsField
|
||||
This is a ManyToManyField using the pretixcontrol.views.forms.VariationsField
|
||||
form field by default.
|
||||
"""
|
||||
|
||||
def formfield(self, **kwargs):
|
||||
from tixlcontrol.views.forms import VariationsField as FVariationsField
|
||||
from pretixcontrol.views.forms import VariationsField as FVariationsField
|
||||
from django.db.models.fields.related import RelatedField
|
||||
defaults = {
|
||||
'form_class': FVariationsField,
|
||||
@@ -801,7 +801,7 @@ class BaseRestriction(Versionable):
|
||||
related_name="restrictions_%(app_label)s_%(class)s",
|
||||
)
|
||||
variations = VariationsField(
|
||||
'tixlbase.ItemVariation',
|
||||
'pretixbase.ItemVariation',
|
||||
blank=True,
|
||||
verbose_name=_("Variations"),
|
||||
related_name="restrictions_%(app_label)s_%(class)s",
|
||||
@@ -2,7 +2,7 @@ import django.dispatch
|
||||
from django.apps import apps
|
||||
from django.dispatch.dispatcher import NO_RECEIVERS
|
||||
|
||||
from tixlbase.models import Event
|
||||
from pretixbase.models import Event
|
||||
|
||||
|
||||
class EventPluginSignal(django.dispatch.Signal):
|
||||
@@ -17,7 +17,7 @@ class EventPluginSignal(django.dispatch.Signal):
|
||||
Send signal from sender to all connected receivers that belong to
|
||||
plugins enabled for the given Event.
|
||||
|
||||
sender is required to be an instance of ``tixlbase.models.Event``.
|
||||
sender is required to be an instance of ``pretixbase.models.Event``.
|
||||
"""
|
||||
assert isinstance(sender, Event)
|
||||
|
||||
@@ -44,7 +44,7 @@ class EventPluginSignal(django.dispatch.Signal):
|
||||
return responses
|
||||
|
||||
"""
|
||||
This signal is sent out every time some component of tixl wants to know whether a specific
|
||||
This signal is sent out every time some component of pretix wants to know whether a specific
|
||||
item or variation is available for sell. The item will only be sold, if all (active) receivers
|
||||
return a positive result (see plugin API documentation for details).
|
||||
"""
|
||||
1
src/pretixbase/static/bootstrap
Submodule
1
src/pretixbase/static/bootstrap
Submodule
Submodule src/pretixbase/static/bootstrap added at 4ed95f5fa2
@@ -4,7 +4,7 @@ from django.test import TestCase
|
||||
from django.core.cache import cache as django_cache
|
||||
from django.utils.timezone import now
|
||||
|
||||
from tixlbase.models import Event, Organizer
|
||||
from pretixbase.models import Event, Organizer
|
||||
|
||||
|
||||
class CacheTest(TestCase):
|
||||
@@ -2,7 +2,7 @@ from django.test import TestCase, Client
|
||||
from django.utils.timezone import now
|
||||
from django.conf import settings
|
||||
|
||||
from tixlbase.models import Event, Organizer, User
|
||||
from pretixbase.models import Event, Organizer, User
|
||||
|
||||
|
||||
class LocaleDeterminationTest(TestCase):
|
||||
@@ -1,11 +1,11 @@
|
||||
from django.test import TestCase
|
||||
from django.utils.timezone import now
|
||||
|
||||
from tixlbase.models import (
|
||||
from pretixbase.models import (
|
||||
Event, Organizer, Item, ItemVariation,
|
||||
Property, PropertyValue, User
|
||||
)
|
||||
from tixlbase.types import VariationDict
|
||||
from pretixbase.types import VariationDict
|
||||
|
||||
|
||||
class ItemVariationsTest(TestCase):
|
||||
@@ -170,7 +170,7 @@ class UserTestCase(TestCase):
|
||||
u = User(event=event, username='tester')
|
||||
u.set_password("test")
|
||||
u.save()
|
||||
self.assertEqual(u.identifier, "%s@%s.event.tixl" % (u.username.lower(), event.id))
|
||||
self.assertEqual(u.identifier, "%s@%s.event.pretix" % (u.username.lower(), event.id))
|
||||
|
||||
def test_identifier_global(self):
|
||||
u = User(email='test@example.com')
|
||||
@@ -2,9 +2,9 @@ from django.test import TestCase
|
||||
from django.utils.timezone import now
|
||||
from django.conf import settings
|
||||
|
||||
from tixlbase.models import Event, Organizer
|
||||
from tixlbase.plugins import get_all_plugins
|
||||
from tixlbase.signals import determine_availability
|
||||
from pretixbase.models import Event, Organizer
|
||||
from pretixbase.plugins import get_all_plugins
|
||||
from pretixbase.signals import determine_availability
|
||||
|
||||
|
||||
class PluginRegistryTest(TestCase):
|
||||
@@ -49,9 +49,9 @@ class PluginSignalTest(TestCase):
|
||||
self.assertEqual(len(responses), 0)
|
||||
|
||||
def test_one_plugin_active(self):
|
||||
self.event.plugins = 'tixlplugins.testdummy'
|
||||
self.event.plugins = 'pretixplugins.testdummy'
|
||||
self.event.save()
|
||||
payload = {'foo': 'bar'}
|
||||
responses = determine_availability.send(self.event, **payload)
|
||||
self.assertEqual(len(responses), 1)
|
||||
self.assertIn('tixlplugins.testdummy.signals', [r[0].__module__ for r in responses])
|
||||
self.assertIn('pretixplugins.testdummy.signals', [r[0].__module__ for r in responses])
|
||||
@@ -7,7 +7,7 @@ from django.contrib.auth import REDIRECT_FIELD_NAME
|
||||
from django.http import HttpResponseNotFound
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from tixlbase.models import Event
|
||||
from pretixbase.models import Event
|
||||
|
||||
|
||||
class PermissionMiddleware:
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.http import HttpResponseForbidden
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from tixlbase.models import EventPermission
|
||||
from pretixbase.models import EventPermission
|
||||
|
||||
|
||||
def event_permission_required(permission):
|
||||
@@ -1,4 +1,4 @@
|
||||
from tixlbase.signals import EventPluginSignal
|
||||
from pretixbase.signals import EventPluginSignal
|
||||
|
||||
|
||||
"""
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "../../../../tixlbase/static/bootstrap/less/bootstrap.less";
|
||||
@import "../../../../pretixbase/static/bootstrap/less/bootstrap.less";
|
||||
|
||||
body {
|
||||
background: #eee;
|
||||
4
src/pretixcontrol/static/pretixcontrol/less/main.less
Normal file
4
src/pretixcontrol/static/pretixcontrol/less/main.less
Normal file
@@ -0,0 +1,4 @@
|
||||
@import "../../../../pretixbase/static/bootstrap/less/bootstrap.less";
|
||||
@import "../../../../pretixbase/static/fontawesome/less/font-awesome.less";
|
||||
@fa-font-path: "../../fontawesome/fonts";
|
||||
@import "forms.less";
|
||||
@@ -6,7 +6,7 @@
|
||||
<head>
|
||||
<title>{{ settings.TIXL_INSTANCE_NAME }}</title>
|
||||
{% compress css %}
|
||||
<link rel="stylesheet" type="text/less" href="{% static "tixlcontrol/less/auth.less" %}" />
|
||||
<link rel="stylesheet" type="text/less" href="{% static "pretixcontrol/less/auth.less" %}" />
|
||||
{% endcompress %}
|
||||
</head>
|
||||
<body>
|
||||
@@ -14,9 +14,9 @@
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
<footer>
|
||||
{% with "href='http://tixl.de'" as a_attr %}
|
||||
{% with "href='http://pretix.de'" as a_attr %}
|
||||
{% blocktrans trimmed %}
|
||||
powered by <a {{ a_attr }}>tixl</a>
|
||||
powered by <a {{ a_attr }}>pretix</a>
|
||||
{% endblocktrans %}
|
||||
{% endwith %}
|
||||
</footer>
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/auth/base.html" %}
|
||||
{% extends "pretixcontrol/auth/base.html" %}
|
||||
{% load bootstrap3 %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
@@ -6,13 +6,13 @@
|
||||
<head>
|
||||
<title>{% block title %}{% endblock %}{% if url_name != "index" %} :: {% endif %}{{ settings.TIXL_INSTANCE_NAME }}</title>
|
||||
{% compress css %}
|
||||
<link rel="stylesheet" type="text/less" href="{% static "tixlcontrol/less/main.less" %}" />
|
||||
<link rel="stylesheet" type="text/less" href="{% static "pretixcontrol/less/main.less" %}" />
|
||||
{% endcompress %}
|
||||
{% compress js %}
|
||||
<script type="text/javascript" src="{% static "jquery/js/jquery-2.1.1.min.js" %}"></script>
|
||||
<script type="text/javascript" src="{% static "js/jquery.formset.js" %}"></script>
|
||||
<script type="text/javascript" src="{% static "bootstrap/dist/js/bootstrap.js" %}"></script>
|
||||
<script type="text/javascript" src="{% static "tixlcontrol/js/ui/main.js" %}"></script>
|
||||
<script type="text/javascript" src="{% static "pretixcontrol/js/ui/main.js" %}"></script>
|
||||
{% endcompress %}
|
||||
</head>
|
||||
<body>
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/base.html" %}
|
||||
{% extends "pretixcontrol/base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block nav %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/event/base.html" %}
|
||||
{% extends "pretixcontrol/event/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{{ request.event.name }}{% endblock %}
|
||||
{% block content %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/event/settings_base.html" %}
|
||||
{% extends "pretixcontrol/event/settings_base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block inside %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/event/settings_base.html" %}
|
||||
{% extends "pretixcontrol/event/settings_base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block inside %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/event/base.html" %}
|
||||
{% extends "pretixcontrol/event/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{{ request.event.name }}{% endblock %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/base.html" %}
|
||||
{% extends "pretixcontrol/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Events" %}{% endblock %}
|
||||
{% block content %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/event/base.html" %}
|
||||
{% extends "pretixcontrol/event/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{{ item.name }} :: {% trans "Item" %}{% endblock %}
|
||||
{% block content %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/item/base.html" %}
|
||||
{% extends "pretixcontrol/item/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block inside %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/item/base.html" %}
|
||||
{% extends "pretixcontrol/item/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% load formset_tags %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/item/base.html" %}
|
||||
{% extends "pretixcontrol/item/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block inside %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/item/base.html" %}
|
||||
{% extends "pretixcontrol/item/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block inside %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/item/base.html" %}
|
||||
{% extends "pretixcontrol/item/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block inside %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/event/base.html" %}
|
||||
{% extends "pretixcontrol/event/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Items" %}{% endblock %}
|
||||
{% block content %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Item categories" %}{% endblock %}
|
||||
{% block inside %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Item category" %}{% endblock %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Delete item category" %}{% endblock %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Items" %}{% endblock %}
|
||||
{% block inside %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Item properties" %}{% endblock %}
|
||||
{% block inside %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% load formset_tags %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Delete item property" %}{% endblock %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Question" %}{% endblock %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Delete question" %}{% endblock %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Questions" %}{% endblock %}
|
||||
{% block inside %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Quota" %}{% endblock %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Delete quota" %}{% endblock %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "tixlcontrol/items/base.html" %}
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Quotas" %}{% endblock %}
|
||||
{% block inside %}
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.test import TestCase, Client
|
||||
|
||||
from tixlbase.models import User
|
||||
from tixlbase.tests import BrowserTest, on_platforms
|
||||
from pretixbase.models import User
|
||||
from pretixbase.tests import BrowserTest, on_platforms
|
||||
|
||||
|
||||
@on_platforms()
|
||||
@@ -1,6 +1,6 @@
|
||||
import datetime
|
||||
from tixlbase.models import User, Organizer, Event, OrganizerPermission, EventPermission
|
||||
from tixlbase.tests import BrowserTest, on_platforms
|
||||
from pretixbase.models import User, Organizer, Event, OrganizerPermission, EventPermission
|
||||
from pretixbase.tests import BrowserTest, on_platforms
|
||||
|
||||
|
||||
@on_platforms()
|
||||
@@ -54,8 +54,8 @@ class EventsTest(BrowserTest):
|
||||
self.driver.get('%s/control/event/%s/%s/settings/plugins' % (self.live_server_url, self.orga1.slug,
|
||||
self.event1.slug))
|
||||
self.assertIn("Restriction by time", self.driver.find_element_by_class_name("form-plugins").text)
|
||||
self.assertIn("Enable", self.driver.find_element_by_name("plugin:tixlplugins.timerestriction").text)
|
||||
self.driver.find_element_by_name("plugin:tixlplugins.timerestriction").click()
|
||||
self.assertIn("Disable", self.driver.find_element_by_name("plugin:tixlplugins.timerestriction").text)
|
||||
self.driver.find_element_by_name("plugin:tixlplugins.timerestriction").click()
|
||||
self.assertIn("Enable", self.driver.find_element_by_name("plugin:tixlplugins.timerestriction").text)
|
||||
self.assertIn("Enable", self.driver.find_element_by_name("plugin:pretixplugins.timerestriction").text)
|
||||
self.driver.find_element_by_name("plugin:pretixplugins.timerestriction").click()
|
||||
self.assertIn("Disable", self.driver.find_element_by_name("plugin:pretixplugins.timerestriction").text)
|
||||
self.driver.find_element_by_name("plugin:pretixplugins.timerestriction").click()
|
||||
self.assertIn("Enable", self.driver.find_element_by_name("plugin:pretixplugins.timerestriction").text)
|
||||
@@ -1,9 +1,9 @@
|
||||
import time
|
||||
import datetime
|
||||
from selenium.webdriver.support.select import Select
|
||||
from tixlbase.models import User, Organizer, Event, OrganizerPermission, EventPermission, ItemCategory, Property, \
|
||||
from pretixbase.models import User, Organizer, Event, OrganizerPermission, EventPermission, ItemCategory, Property, \
|
||||
PropertyValue, Question, Quota, Item
|
||||
from tixlbase.tests import BrowserTest, on_platforms
|
||||
from pretixbase.tests import BrowserTest, on_platforms
|
||||
|
||||
|
||||
class ItemFormTest(BrowserTest):
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.test import TestCase, Client
|
||||
from django.utils.timezone import now
|
||||
|
||||
from tixlbase.models import Event, Organizer, User, EventPermission
|
||||
from pretixbase.models import Event, Organizer, User, EventPermission
|
||||
|
||||
|
||||
class PermissionMiddlewareTest(TestCase):
|
||||
@@ -1,22 +1,22 @@
|
||||
from django.conf.urls import patterns, url, include
|
||||
from tixlcontrol.views import main, event, item
|
||||
from pretixcontrol.views import main, event, item
|
||||
|
||||
urlpatterns = patterns('',)
|
||||
urlpatterns += patterns(
|
||||
'tixlcontrol.views.auth',
|
||||
'pretixcontrol.views.auth',
|
||||
url(r'^logout$', 'logout', name='auth.logout'),
|
||||
url(r'^login$', 'login', name='auth.login'),
|
||||
)
|
||||
urlpatterns += patterns(
|
||||
'tixlcontrol.views.main',
|
||||
'pretixcontrol.views.main',
|
||||
url(r'^$', 'index', name='index'),
|
||||
url(r'^events/$', main.EventList.as_view(), name='events'),
|
||||
)
|
||||
urlpatterns += patterns(
|
||||
'tixlcontrol.views.event',
|
||||
'pretixcontrol.views.event',
|
||||
url(r'^event/(?P<organizer>[^/]+)/(?P<event>[^/]+)/', include(
|
||||
patterns(
|
||||
'tixlcontrol.views',
|
||||
'pretixcontrol.views',
|
||||
url(r'^$', 'event.index', name='event.index'),
|
||||
url(r'^settings/$', event.EventUpdate.as_view(), name='event.settings'),
|
||||
url(r'^settings/plugins$', event.EventPlugins.as_view(), name='event.settings.plugins'),
|
||||
@@ -64,7 +64,7 @@ def login(request):
|
||||
else:
|
||||
form = AuthenticationForm()
|
||||
ctx['form'] = form
|
||||
return render(request, 'tixlcontrol/auth/login.html', ctx)
|
||||
return render(request, 'pretixcontrol/auth/login.html', ctx)
|
||||
|
||||
|
||||
def logout(request):
|
||||
@@ -7,10 +7,10 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from pytz import common_timezones
|
||||
from tixlbase.forms import VersionedModelForm
|
||||
from pretixbase.forms import VersionedModelForm
|
||||
|
||||
from tixlbase.models import Event
|
||||
from tixlcontrol.permissions import EventPermissionRequiredMixin
|
||||
from pretixbase.models import Event
|
||||
from pretixcontrol.permissions import EventPermissionRequiredMixin
|
||||
|
||||
|
||||
class EventUpdateForm(VersionedModelForm):
|
||||
@@ -50,7 +50,7 @@ class EventUpdateForm(VersionedModelForm):
|
||||
class EventUpdate(EventPermissionRequiredMixin, UpdateView):
|
||||
model = Event
|
||||
form_class = EventUpdateForm
|
||||
template_name = 'tixlcontrol/event/settings.html'
|
||||
template_name = 'pretixcontrol/event/settings.html'
|
||||
permission = 'can_change_settings'
|
||||
|
||||
def get_object(self, queryset=None) -> Event:
|
||||
@@ -68,13 +68,13 @@ class EventPlugins(EventPermissionRequiredMixin, TemplateView, SingleObjectMixin
|
||||
model = Event
|
||||
context_object_name = 'event'
|
||||
permission = 'can_change_settings'
|
||||
template_name = 'tixlcontrol/event/plugins.html'
|
||||
template_name = 'pretixcontrol/event/plugins.html'
|
||||
|
||||
def get_object(self, queryset=None) -> Event:
|
||||
return self.request.event
|
||||
|
||||
def get_context_data(self, *args, **kwargs) -> dict:
|
||||
from tixlbase.plugins import get_all_plugins
|
||||
from pretixbase.plugins import get_all_plugins
|
||||
context = super().get_context_data(*args, **kwargs)
|
||||
context['plugins'] = [p for p in get_all_plugins() if not p.name.startswith('.')]
|
||||
context['plugins_active'] = self.object.get_plugins()
|
||||
@@ -107,4 +107,4 @@ class EventPlugins(EventPermissionRequiredMixin, TemplateView, SingleObjectMixin
|
||||
|
||||
|
||||
def index(request, organizer, event):
|
||||
return render(request, 'tixlcontrol/event/index.html', {})
|
||||
return render(request, 'pretixcontrol/event/index.html', {})
|
||||
@@ -7,9 +7,9 @@ from django.utils.encoding import force_text
|
||||
from django.utils.html import format_html
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from tixlbase.forms import VersionedModelForm
|
||||
from pretixbase.forms import VersionedModelForm
|
||||
|
||||
from tixlbase.models import ItemVariation, PropertyValue, Item
|
||||
from pretixbase.models import ItemVariation, PropertyValue, Item
|
||||
|
||||
|
||||
class TolerantFormsetModelForm(VersionedModelForm):
|
||||
@@ -137,7 +137,7 @@ class VariationsFieldRenderer(forms.widgets.CheckboxFieldRenderer):
|
||||
start_tag = format_html('<div class="variations" id="{0}">', id_) if id_ else '<div class="variations">'
|
||||
output = [start_tag]
|
||||
|
||||
# TODO: This is very duplicate to tixlcontrol.views.item.ItemVariations.get_forms()
|
||||
# TODO: This is very duplicate to pretixcontrol.views.item.ItemVariations.get_forms()
|
||||
# Find a common abstraction to avoid the repetition.
|
||||
if dimension == 0:
|
||||
output.append(format_html('<em>{0}</em>', _("not applicable")))
|
||||
@@ -247,7 +247,7 @@ class VariationsField(forms.ModelMultipleChoiceField):
|
||||
|
||||
As this field expects the non-standard keyword parameter ``item``
|
||||
at initialization time, this is field is normally named ``variations``
|
||||
and lives inside a ``tixlcontrol.views.forms.RestrictionForm``, which
|
||||
and lives inside a ``pretixcontrol.views.forms.RestrictionForm``, which
|
||||
does some magic to provide this parameter.
|
||||
"""
|
||||
|
||||
@@ -294,7 +294,7 @@ class VariationsField(forms.ModelMultipleChoiceField):
|
||||
if self.item is None:
|
||||
raise ValueError(
|
||||
"VariationsField object was not properly initialized. Please"
|
||||
"use a tixlcontrol.views.forms.RestrictionForm form instead of"
|
||||
"use a pretixcontrol.views.forms.RestrictionForm form instead of"
|
||||
"a plain Django ModelForm"
|
||||
)
|
||||
|
||||
@@ -12,20 +12,20 @@ from django.http import HttpResponseRedirect, HttpResponseForbidden
|
||||
from django.shortcuts import redirect
|
||||
from django.forms.models import inlineformset_factory
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from tixlbase.forms import VersionedModelForm
|
||||
from pretixbase.forms import VersionedModelForm
|
||||
|
||||
from tixlbase.models import (
|
||||
from pretixbase.models import (
|
||||
Item, ItemCategory, Property, ItemVariation, PropertyValue, Question, Quota,
|
||||
Versionable)
|
||||
from tixlcontrol.permissions import EventPermissionRequiredMixin, event_permission_required
|
||||
from tixlcontrol.views.forms import TolerantFormsetModelForm, VariationsField
|
||||
from tixlcontrol.signals import restriction_formset
|
||||
from pretixcontrol.permissions import EventPermissionRequiredMixin, event_permission_required
|
||||
from pretixcontrol.views.forms import TolerantFormsetModelForm, VariationsField
|
||||
from pretixcontrol.signals import restriction_formset
|
||||
|
||||
|
||||
class ItemList(ListView):
|
||||
model = Item
|
||||
context_object_name = 'items'
|
||||
template_name = 'tixlcontrol/items/index.html'
|
||||
template_name = 'pretixcontrol/items/index.html'
|
||||
|
||||
def get_queryset(self):
|
||||
return Item.objects.current.filter(
|
||||
@@ -46,7 +46,7 @@ class CategoryForm(VersionedModelForm):
|
||||
class CategoryDelete(EventPermissionRequiredMixin, DeleteView):
|
||||
model = ItemCategory
|
||||
form_class = CategoryForm
|
||||
template_name = 'tixlcontrol/items/category_delete.html'
|
||||
template_name = 'pretixcontrol/items/category_delete.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'category'
|
||||
|
||||
@@ -76,7 +76,7 @@ class CategoryDelete(EventPermissionRequiredMixin, DeleteView):
|
||||
class CategoryUpdate(EventPermissionRequiredMixin, UpdateView):
|
||||
model = ItemCategory
|
||||
form_class = CategoryForm
|
||||
template_name = 'tixlcontrol/items/category.html'
|
||||
template_name = 'pretixcontrol/items/category.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'category'
|
||||
|
||||
@@ -96,7 +96,7 @@ class CategoryUpdate(EventPermissionRequiredMixin, UpdateView):
|
||||
class CategoryCreate(EventPermissionRequiredMixin, CreateView):
|
||||
model = ItemCategory
|
||||
form_class = CategoryForm
|
||||
template_name = 'tixlcontrol/items/category.html'
|
||||
template_name = 'pretixcontrol/items/category.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'category'
|
||||
|
||||
@@ -114,7 +114,7 @@ class CategoryCreate(EventPermissionRequiredMixin, CreateView):
|
||||
class CategoryList(ListView):
|
||||
model = ItemCategory
|
||||
context_object_name = 'categories'
|
||||
template_name = 'tixlcontrol/items/categories.html'
|
||||
template_name = 'pretixcontrol/items/categories.html'
|
||||
|
||||
def get_queryset(self):
|
||||
return self.request.event.categories.current.all()
|
||||
@@ -164,7 +164,7 @@ def category_move_down(request, organizer, event, category):
|
||||
class PropertyList(ListView):
|
||||
model = Property
|
||||
context_object_name = 'properties'
|
||||
template_name = 'tixlcontrol/items/properties.html'
|
||||
template_name = 'pretixcontrol/items/properties.html'
|
||||
|
||||
def get_queryset(self):
|
||||
return Property.objects.current.filter(
|
||||
@@ -193,7 +193,7 @@ class PropertyValueForm(TolerantFormsetModelForm):
|
||||
class PropertyUpdate(EventPermissionRequiredMixin, UpdateView):
|
||||
model = Property
|
||||
form_class = PropertyForm
|
||||
template_name = 'tixlcontrol/items/property.html'
|
||||
template_name = 'pretixcontrol/items/property.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'property'
|
||||
|
||||
@@ -255,7 +255,7 @@ class PropertyUpdate(EventPermissionRequiredMixin, UpdateView):
|
||||
class PropertyCreate(EventPermissionRequiredMixin, CreateView):
|
||||
model = Property
|
||||
form_class = PropertyForm
|
||||
template_name = 'tixlcontrol/items/property.html'
|
||||
template_name = 'pretixcontrol/items/property.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'property'
|
||||
|
||||
@@ -304,7 +304,7 @@ class PropertyCreate(EventPermissionRequiredMixin, CreateView):
|
||||
class PropertyDelete(EventPermissionRequiredMixin, DeleteView):
|
||||
model = Property
|
||||
form_class = PropertyForm
|
||||
template_name = 'tixlcontrol/items/property_delete.html'
|
||||
template_name = 'pretixcontrol/items/property_delete.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'property'
|
||||
|
||||
@@ -343,7 +343,7 @@ class PropertyDelete(EventPermissionRequiredMixin, DeleteView):
|
||||
class QuestionList(ListView):
|
||||
model = Question
|
||||
context_object_name = 'questions'
|
||||
template_name = 'tixlcontrol/items/questions.html'
|
||||
template_name = 'pretixcontrol/items/questions.html'
|
||||
|
||||
def get_queryset(self):
|
||||
return self.request.event.questions.current.all()
|
||||
@@ -363,7 +363,7 @@ class QuestionForm(VersionedModelForm):
|
||||
|
||||
class QuestionDelete(EventPermissionRequiredMixin, DeleteView):
|
||||
model = Question
|
||||
template_name = 'tixlcontrol/items/question_delete.html'
|
||||
template_name = 'pretixcontrol/items/question_delete.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'question'
|
||||
|
||||
@@ -394,7 +394,7 @@ class QuestionDelete(EventPermissionRequiredMixin, DeleteView):
|
||||
class QuestionUpdate(EventPermissionRequiredMixin, UpdateView):
|
||||
model = Question
|
||||
form_class = QuestionForm
|
||||
template_name = 'tixlcontrol/items/question.html'
|
||||
template_name = 'pretixcontrol/items/question.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'question'
|
||||
|
||||
@@ -414,7 +414,7 @@ class QuestionUpdate(EventPermissionRequiredMixin, UpdateView):
|
||||
class QuestionCreate(EventPermissionRequiredMixin, CreateView):
|
||||
model = Question
|
||||
form_class = QuestionForm
|
||||
template_name = 'tixlcontrol/items/question.html'
|
||||
template_name = 'pretixcontrol/items/question.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'question'
|
||||
|
||||
@@ -432,7 +432,7 @@ class QuestionCreate(EventPermissionRequiredMixin, CreateView):
|
||||
class QuotaList(ListView):
|
||||
model = Quota
|
||||
context_object_name = 'quotas'
|
||||
template_name = 'tixlcontrol/items/quotas.html'
|
||||
template_name = 'pretixcontrol/items/quotas.html'
|
||||
|
||||
def get_queryset(self):
|
||||
return Quota.objects.current.filter(
|
||||
@@ -511,7 +511,7 @@ class QuotaEditorMixin:
|
||||
res = super().form_valid(form)
|
||||
# The following commented-out checks are not necessary as both self.object.items
|
||||
# and self.object.variations can be expected empty due to the performance
|
||||
# optimization of tixlbase.models.Versionable.clone_shallow()
|
||||
# optimization of pretixbase.models.Versionable.clone_shallow()
|
||||
# items = self.object.items.all()
|
||||
# variations = self.object.variations.all()
|
||||
self.object = form.instance
|
||||
@@ -536,7 +536,7 @@ class QuotaEditorMixin:
|
||||
class QuotaCreate(EventPermissionRequiredMixin, QuotaEditorMixin, CreateView):
|
||||
model = Quota
|
||||
form_class = QuotaForm
|
||||
template_name = 'tixlcontrol/items/quota.html'
|
||||
template_name = 'pretixcontrol/items/quota.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'quota'
|
||||
|
||||
@@ -554,7 +554,7 @@ class QuotaCreate(EventPermissionRequiredMixin, QuotaEditorMixin, CreateView):
|
||||
class QuotaUpdate(EventPermissionRequiredMixin, QuotaEditorMixin, UpdateView):
|
||||
model = Quota
|
||||
form_class = QuotaForm
|
||||
template_name = 'tixlcontrol/items/quota.html'
|
||||
template_name = 'pretixcontrol/items/quota.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'quota'
|
||||
|
||||
@@ -573,7 +573,7 @@ class QuotaUpdate(EventPermissionRequiredMixin, QuotaEditorMixin, UpdateView):
|
||||
|
||||
class QuotaDelete(EventPermissionRequiredMixin, DeleteView):
|
||||
model = Quota
|
||||
template_name = 'tixlcontrol/items/quota_delete.html'
|
||||
template_name = 'pretixcontrol/items/quota_delete.html'
|
||||
permission = 'can_change_items'
|
||||
context_object_name = 'quota'
|
||||
|
||||
@@ -641,7 +641,7 @@ class ItemFormGeneral(VersionedModelForm):
|
||||
|
||||
class ItemCreate(EventPermissionRequiredMixin, CreateView):
|
||||
form_class = ItemFormGeneral
|
||||
template_name = 'tixlcontrol/item/index.html'
|
||||
template_name = 'pretixcontrol/item/index.html'
|
||||
permission = 'can_change_items'
|
||||
|
||||
def get_success_url(self) -> str:
|
||||
@@ -663,7 +663,7 @@ class ItemCreate(EventPermissionRequiredMixin, CreateView):
|
||||
|
||||
class ItemUpdateGeneral(ItemDetailMixin, EventPermissionRequiredMixin, UpdateView):
|
||||
form_class = ItemFormGeneral
|
||||
template_name = 'tixlcontrol/item/index.html'
|
||||
template_name = 'pretixcontrol/item/index.html'
|
||||
permission = 'can_change_items'
|
||||
|
||||
def get_success_url(self) -> str:
|
||||
@@ -822,11 +822,11 @@ class ItemVariations(ItemDetailMixin, EventPermissionRequiredMixin, TemplateView
|
||||
|
||||
def get_template_names(self) -> "List[str]":
|
||||
if self.dimension == 0:
|
||||
return ['tixlcontrol/item/variations_0d.html']
|
||||
return ['pretixcontrol/item/variations_0d.html']
|
||||
elif self.dimension == 1:
|
||||
return ['tixlcontrol/item/variations_1d.html']
|
||||
return ['pretixcontrol/item/variations_1d.html']
|
||||
elif self.dimension >= 2:
|
||||
return ['tixlcontrol/item/variations_nd.html']
|
||||
return ['pretixcontrol/item/variations_nd.html']
|
||||
|
||||
def get_context_data(self, **kwargs) -> dict:
|
||||
context = super().get_context_data(**kwargs)
|
||||
@@ -838,7 +838,7 @@ class ItemVariations(ItemDetailMixin, EventPermissionRequiredMixin, TemplateView
|
||||
class ItemRestrictions(ItemDetailMixin, EventPermissionRequiredMixin, TemplateView):
|
||||
|
||||
permission = 'can_change_items'
|
||||
template_name = 'tixlcontrol/item/restrictions.html'
|
||||
template_name = 'pretixcontrol/item/restrictions.html'
|
||||
|
||||
def get_formsets(self):
|
||||
responses = restriction_formset.send(self.object.event, item=self.object)
|
||||
@@ -1,13 +1,13 @@
|
||||
from django.shortcuts import render
|
||||
from django.views.generic import ListView
|
||||
|
||||
from tixlbase.models import Event
|
||||
from pretixbase.models import Event
|
||||
|
||||
|
||||
class EventList(ListView):
|
||||
model = Event
|
||||
context_object_name = 'events'
|
||||
template_name = 'tixlcontrol/events/index.html'
|
||||
template_name = 'pretixcontrol/events/index.html'
|
||||
|
||||
def get_queryset(self):
|
||||
return Event.objects.current.filter(
|
||||
@@ -18,4 +18,4 @@ class EventList(ListView):
|
||||
|
||||
|
||||
def index(request):
|
||||
return render(request, 'tixlcontrol/base.html', {})
|
||||
return render(request, 'pretixcontrol/base.html', {})
|
||||
@@ -1,9 +1,9 @@
|
||||
from django.apps import AppConfig
|
||||
from tixlbase.plugins import PluginType
|
||||
from pretixbase.plugins import PluginType
|
||||
|
||||
|
||||
class TestDummyApp(AppConfig):
|
||||
name = 'tixlplugins.testdummy'
|
||||
name = 'pretixplugins.testdummy'
|
||||
verbose_name = '.testdummy'
|
||||
|
||||
class TixlPluginMeta:
|
||||
@@ -14,4 +14,4 @@ class TestDummyApp(AppConfig):
|
||||
def ready(self):
|
||||
from . import signals # NOQA
|
||||
|
||||
default_app_config = 'tixlplugins.testdummy.TestDummyApp'
|
||||
default_app_config = 'pretixplugins.testdummy.TestDummyApp'
|
||||
@@ -1,6 +1,6 @@
|
||||
from django.dispatch import receiver
|
||||
|
||||
from tixlbase.signals import determine_availability
|
||||
from pretixbase.signals import determine_availability
|
||||
|
||||
|
||||
@receiver(determine_availability)
|
||||
@@ -1,16 +1,16 @@
|
||||
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 = _("Restriction 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 " +
|
||||
@@ -19,4 +19,4 @@ class TimeRestrictionApp(AppConfig):
|
||||
def ready(self):
|
||||
from . import signals # NOQA
|
||||
|
||||
default_app_config = 'tixlplugins.timerestriction.TimeRestrictionApp'
|
||||
default_app_config = 'pretixplugins.timerestriction.TimeRestrictionApp'
|
||||
@@ -2,14 +2,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import tixlbase.models
|
||||
import pretixbase.models
|
||||
import versions.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('tixlbase', '0001_initial'),
|
||||
('pretixbase', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
@@ -24,9 +24,9 @@ class Migration(migrations.Migration):
|
||||
('timeframe_from', models.DateTimeField(verbose_name='Start of time frame')),
|
||||
('timeframe_to', models.DateTimeField(verbose_name='End of time frame')),
|
||||
('price', models.DecimalField(null=True, blank=True, verbose_name='Price in time frame', max_digits=7, decimal_places=2)),
|
||||
('event', versions.models.VersionedForeignKey(to='tixlbase.Event', related_name='restrictions_timerestriction_timerestriction', verbose_name='Event')),
|
||||
('item', versions.models.VersionedForeignKey(to='tixlbase.Item', blank=True, null=True, related_name='restrictions_timerestriction_timerestriction', verbose_name='Item')),
|
||||
('variations', tixlbase.models.VariationsField(to='tixlbase.ItemVariation', blank=True, verbose_name='Variations', related_name='restrictions_timerestriction_timerestriction')),
|
||||
('event', versions.models.VersionedForeignKey(to='pretixbase.Event', related_name='restrictions_timerestriction_timerestriction', verbose_name='Event')),
|
||||
('item', versions.models.VersionedForeignKey(to='pretixbase.Item', blank=True, null=True, related_name='restrictions_timerestriction_timerestriction', verbose_name='Item')),
|
||||
('variations', pretixbase.models.VariationsField(to='pretixbase.ItemVariation', blank=True, verbose_name='Variations', related_name='restrictions_timerestriction_timerestriction')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Restriction',
|
||||
@@ -1,7 +1,7 @@
|
||||
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):
|
||||
@@ -3,10 +3,10 @@ from django.utils.timezone import now
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.forms.models import inlineformset_factory
|
||||
|
||||
from tixlbase.signals import determine_availability
|
||||
from tixlbase.models import Item
|
||||
from tixlcontrol.views.forms import VariationsField, RestrictionInlineFormset, RestrictionForm
|
||||
from tixlcontrol.signals import restriction_formset
|
||||
from pretixbase.signals import determine_availability
|
||||
from pretixbase.models import Item
|
||||
from pretixcontrol.views.forms import VariationsField, RestrictionInlineFormset, RestrictionForm
|
||||
from pretixcontrol.signals import restriction_formset
|
||||
|
||||
from .models import TimeRestriction
|
||||
|
||||
@@ -3,13 +3,13 @@ from datetime import timedelta
|
||||
from django.test import TestCase
|
||||
from django.utils.timezone import now
|
||||
|
||||
from tixlbase.models import (
|
||||
from pretixbase.models import (
|
||||
Event, Organizer, Item, Property, PropertyValue, ItemVariation
|
||||
)
|
||||
|
||||
# Do NOT use relative imports here
|
||||
from tixlplugins.timerestriction import signals
|
||||
from tixlplugins.timerestriction.models import TimeRestriction
|
||||
from pretixplugins.timerestriction import signals
|
||||
from pretixplugins.timerestriction.models import TimeRestriction
|
||||
|
||||
|
||||
class TimeRestrictionTest(TestCase):
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user