mirror of
https://github.com/pretix/pretix.git
synced 2026-08-11 10:57:00 +00:00
Restructure our python module. A lot.
This commit is contained in:
+4
-4
@@ -1,6 +1,6 @@
|
||||
[submodule "src/pretixbase/static/bootstrap"]
|
||||
path = src/pretixbase/static/bootstrap
|
||||
[submodule "src/pretix/base/static/bootstrap"]
|
||||
path = src/pretix/base/static/bootstrap
|
||||
url = https://github.com/twbs/bootstrap.git
|
||||
[submodule "src/pretixbase/static/fontawesome"]
|
||||
path = src/pretixbase/static/fontawesome
|
||||
[submodule "src/pretix/base/static/fontawesome"]
|
||||
path = src/pretix/base/static/fontawesome
|
||||
url = https://github.com/FortAwesome/Font-Awesome.git
|
||||
|
||||
@@ -55,7 +55,7 @@ example, taken from the time restriction module (see next chapter) as a template
|
||||
name = 'pretixplugins.timerestriction'
|
||||
verbose_name = _("Time restriction")
|
||||
|
||||
class TixlPluginMeta:
|
||||
class PretixPluginMeta:
|
||||
type = PluginType.RESTRICTION
|
||||
name = _("Restriciton by time")
|
||||
author = _("the pretix team")
|
||||
@@ -70,7 +70,7 @@ example, taken from the time restriction module (see next chapter) as a template
|
||||
default_app_config = 'pretixplugins.timerestriction.TimeRestrictionApp'
|
||||
|
||||
.. IMPORTANT::
|
||||
You have to implement a ``TixlPluginMeta`` class like in the example to make your
|
||||
You have to implement a ``PretixPluginMeta`` class like in the example to make your
|
||||
plugin available to the users.
|
||||
|
||||
.. _signal dispatcher: https://docs.djangoproject.com/en/1.7/topics/signals/
|
||||
|
||||
@@ -9,26 +9,26 @@ The components
|
||||
|
||||
The project pretix is split into several components. The main three of them are:
|
||||
|
||||
**pretixbase**
|
||||
Tixlbase is the foundation below all other components. It is primarily
|
||||
**pretix.base**
|
||||
Pretixbase 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.
|
||||
|
||||
**pretixcontrol**
|
||||
Tixlcontrol is the web-based backend software which allows organizers to
|
||||
**pretix.control**
|
||||
Pretixcontrol is the web-based backend software which allows organizers to
|
||||
create and manage their events, items, orders and tickets.
|
||||
|
||||
**pretixpresale**
|
||||
Tixlpresale is the ticket-shop itself, containing all the parts visible to the
|
||||
**pretix.presale**
|
||||
Pretixpresale is the ticket-shop itself, containing all the parts visible to the
|
||||
end user.
|
||||
|
||||
Users and events
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Tixl is all about **events**, which are defined as something happening somewhere.
|
||||
Pretix 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
|
||||
Pretix is used by **users**. We want to enable global users who can just login into
|
||||
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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Development goals
|
||||
=================
|
||||
|
||||
Tixl is a web software handling presale of event tickets.
|
||||
Pretix is a web software handling presale of event tickets.
|
||||
|
||||
Technical goals
|
||||
---------------
|
||||
@@ -19,7 +19,7 @@ Feature goals
|
||||
|
||||
* 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.
|
||||
*Tixe is abstract in many ways to adopt to as much events as possible.
|
||||
|
||||
* Tickets are only an instance of an abstract model called items, such that the system can also sell e.g. merchandise
|
||||
* An abstract concept of restriction is used to restrict the selling of tickets, for example by date, by number or by user permissions.
|
||||
|
||||
@@ -7,22 +7,22 @@ Python source code
|
||||
All the source code lives in ``src/``, which has several subdirectories.
|
||||
|
||||
pretix/
|
||||
This directory contains the basic Django settings and URL routing.
|
||||
This directory contains nearly all source code.
|
||||
|
||||
pretixbase/
|
||||
This is the django app containing all the models and methods which are
|
||||
essential to all of pretix's features.
|
||||
base/
|
||||
This is the django app containing all the models and methods which are
|
||||
essential to all of pretix's features.
|
||||
|
||||
pretixcontrol/
|
||||
This is the django app containing the frontend for organizers.
|
||||
control/
|
||||
This is the django app containing the frontend for organizers.
|
||||
|
||||
pretixpresale/
|
||||
This is the django app containing the frontend for users buying tickets.
|
||||
presale/
|
||||
This is the django app containing the frontend for users buying tickets.
|
||||
|
||||
helpers/
|
||||
Helpers contain a very few modules providing workarounds for low-level flaws in
|
||||
Django or installed 3rd-party packages, like a filter to combine the ``lessc``
|
||||
preprocessor with ``django-compressor``'s URL rewriting.
|
||||
helpers/
|
||||
Helpers contain a very few modules providing workarounds for low-level flaws in
|
||||
Django or installed 3rd-party packages, like a filter to combine the ``lessc``
|
||||
preprocessor with ``django-compressor``'s URL rewriting.
|
||||
|
||||
Language files
|
||||
--------------
|
||||
@@ -37,21 +37,25 @@ 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.
|
||||
|
||||
pretixcontrol
|
||||
pretixcontrol has two main LESS files, ``pretixcontrol/static/pretixcontrol/less/main.less`` and
|
||||
``pretixcontrol/static/pretixcontrol/less/auth.less``, importing everything else.
|
||||
pretix.control
|
||||
pretixcontrol has two main LESS files, ``pretix/control/static/pretixcontrol/less/main.less`` and
|
||||
``pretix/control/static/pretixcontrol/less/auth.less``, importing everything else.
|
||||
|
||||
pretix.presale
|
||||
pretixpresale has one main LESS files, ``pretix/control/static/pretix/presale/less/main.less``,
|
||||
importing everything else.
|
||||
|
||||
3rd-party assets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Bootstrap
|
||||
Bootstrap lives as a git submodule at ``pretixbase/static/bootstrap/``
|
||||
Bootstrap lives as a git submodule at ``pretix/base/static/bootstrap/``
|
||||
|
||||
Font Awesome
|
||||
Font Awesome lives as a git submodule at ``pretixbase/static/fontawesome/``
|
||||
Font Awesome lives as a git submodule at ``pretix/base/static/fontawesome/``
|
||||
|
||||
jQuery
|
||||
jQuery lives as a single JavaScript file in ``pretixbase/static/jquery/js/``
|
||||
jQuery lives as a single JavaScript file in ``pretix/base/static/jquery/js/``
|
||||
|
||||
jQuery plugin: Django formsets
|
||||
Our own modified version of `django-formset-js`_ is available as an independent
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
[run]
|
||||
source = pretixbase,pretixcontrol,pretixpresale,pretixplugins
|
||||
source = pretix
|
||||
omit = */migrations/*,*/urls.py,*/tests/*,*/testdummy/*,*/admin.py
|
||||
|
||||
[report]
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class PretixBaseConfig(AppConfig):
|
||||
name = 'pretix.base'
|
||||
label = 'pretixbase'
|
||||
|
||||
default_app_config = 'pretix.base.PretixBaseConfig'
|
||||
@@ -3,13 +3,13 @@ from django.contrib.auth.admin import UserAdmin
|
||||
from django.utils.translation import ugettext as _
|
||||
from django import forms
|
||||
|
||||
from pretixbase.models import (
|
||||
from pretix.base.models import (
|
||||
User, Organizer, OrganizerPermission, Event, EventPermission,
|
||||
Property, PropertyValue, Item, ItemVariation, ItemCategory
|
||||
)
|
||||
|
||||
|
||||
class TixlUserCreationForm(forms.ModelForm):
|
||||
class PretixUserCreationForm(forms.ModelForm):
|
||||
|
||||
"""
|
||||
A form that creates a user, with no privileges, from the given username and
|
||||
@@ -39,14 +39,14 @@ class TixlUserCreationForm(forms.ModelForm):
|
||||
return password2
|
||||
|
||||
def save(self, commit=True):
|
||||
user = super(TixlUserCreationForm, self).save(commit=False)
|
||||
user = super(PretixUserCreationForm, self).save(commit=False)
|
||||
user.set_password(self.cleaned_data["password1"])
|
||||
if commit:
|
||||
user.save()
|
||||
return user
|
||||
|
||||
|
||||
class TixlUserAdmin(UserAdmin):
|
||||
class PretixUserAdmin(UserAdmin):
|
||||
|
||||
fieldsets = (
|
||||
(None, {'fields': ('identifier', 'event', 'username', 'password')}),
|
||||
@@ -59,7 +59,7 @@ class TixlUserAdmin(UserAdmin):
|
||||
search_fields = ('identifier', 'username', 'givenname', 'familyname', 'email')
|
||||
ordering = ('identifier',)
|
||||
list_filter = ('is_staff', 'is_active', 'groups')
|
||||
add_form = TixlUserCreationForm
|
||||
add_form = PretixUserCreationForm
|
||||
|
||||
|
||||
class OrganizerPermissionInline(admin.TabularInline):
|
||||
@@ -126,7 +126,7 @@ class ItemAdmin(admin.ModelAdmin):
|
||||
search_fields = ('name', 'event', 'category', 'short_description')
|
||||
|
||||
|
||||
admin.site.register(User, TixlUserAdmin)
|
||||
admin.site.register(User, PretixUserAdmin)
|
||||
admin.site.register(Organizer, OrganizerAdmin)
|
||||
admin.site.register(Event, EventAdmin)
|
||||
admin.site.register(Property, PropertyAdmin)
|
||||
@@ -3,7 +3,7 @@ import hashlib
|
||||
|
||||
from django.core.cache import caches
|
||||
|
||||
from pretixbase.models import Event
|
||||
from pretix.base.models import Event
|
||||
|
||||
|
||||
class EventRelatedCache:
|
||||
+3
-2
@@ -7,7 +7,7 @@ import django.core.validators
|
||||
from django.conf import settings
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
import pretixbase.models
|
||||
import pretix.base.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -322,7 +322,8 @@ class Migration(migrations.Migration):
|
||||
('items', versions.models.VersionedManyToManyField(blank=True, related_name='quotas', 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, related_name='quotas', to='pretixbase.ItemVariation', verbose_name='Variations')),
|
||||
('variations', pretix.base.models.VariationsField(blank=True, related_name='quotas',
|
||||
to='pretixbase.ItemVariation', verbose_name='Variations')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Quotas',
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import pretixbase.models
|
||||
import pretix.base.models
|
||||
import versions.models
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import versions.models
|
||||
import pretixbase.models
|
||||
import pretix.base.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
+1
-1
@@ -5,7 +5,7 @@ from django.db import models, migrations
|
||||
from django.utils.timezone import utc
|
||||
import versions.models
|
||||
import datetime
|
||||
import pretixbase.models
|
||||
import pretix.base.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import pretixbase.models
|
||||
import pretix.base.models
|
||||
import versions.models
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import pretixbase.models
|
||||
import pretix.base.models
|
||||
import versions.models
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import versions.models
|
||||
import pretixbase.models
|
||||
import pretix.base.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -382,8 +382,8 @@ class Event(Versionable):
|
||||
"DATETIME_FORMAT" if self.show_times else "DATE_FORMAT"
|
||||
)
|
||||
|
||||
def get_cache(self) -> "pretixbase.cache.EventRelatedCache":
|
||||
from pretixbase.cache import EventRelatedCache
|
||||
def get_cache(self) -> "pretix.base.cache.EventRelatedCache":
|
||||
from pretix.base.cache import EventRelatedCache
|
||||
return EventRelatedCache(self)
|
||||
|
||||
|
||||
@@ -929,7 +929,7 @@ class VariationsField(VersionedManyToManyField):
|
||||
"""
|
||||
|
||||
def formfield(self, **kwargs):
|
||||
from pretixcontrol.views.forms import VariationsField as FVariationsField
|
||||
from pretix.control.views.forms import VariationsField as FVariationsField
|
||||
from django.db.models.fields.related import RelatedField
|
||||
defaults = {
|
||||
'form_class': FVariationsField,
|
||||
@@ -12,12 +12,12 @@ class PluginType(Enum):
|
||||
|
||||
def get_all_plugins() -> "List[class]":
|
||||
"""
|
||||
Returns the TixlPluginMeta classes of all plugins found in the installed Django apps.
|
||||
Returns the PretixPluginMeta classes of all plugins found in the installed Django apps.
|
||||
"""
|
||||
plugins = []
|
||||
for app in apps.get_app_configs():
|
||||
if hasattr(app, 'TixlPluginMeta'):
|
||||
meta = app.TixlPluginMeta
|
||||
if hasattr(app, 'PretixPluginMeta'):
|
||||
meta = app.PretixPluginMeta
|
||||
meta.module = app.name
|
||||
plugins.append(meta)
|
||||
return plugins
|
||||
@@ -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 ``pretixbase.models.Event``.
|
||||
sender is required to be an instance of ``pretix.base.models.Event``.
|
||||
"""
|
||||
assert isinstance(sender, Event)
|
||||
|
||||
@@ -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 pretixbase.models import Event, Organizer
|
||||
from pretix.base.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 pretixbase.models import Event, Organizer, User
|
||||
from pretix.base.models import Event, Organizer, User
|
||||
|
||||
|
||||
class LocaleDeterminationTest(TestCase):
|
||||
@@ -2,12 +2,12 @@ from datetime import timedelta
|
||||
from django.test import TestCase
|
||||
from django.utils.timezone import now
|
||||
|
||||
from pretixbase.models import (
|
||||
from pretix.base.models import (
|
||||
Event, Organizer, Item, ItemVariation,
|
||||
Property, PropertyValue, User, Quota,
|
||||
Order, OrderPosition, CartPosition
|
||||
)
|
||||
from pretixbase.types import VariationDict
|
||||
from pretix.base.types import VariationDict
|
||||
|
||||
|
||||
class ItemVariationsTest(TestCase):
|
||||
@@ -2,9 +2,9 @@ from django.test import TestCase
|
||||
from django.utils.timezone import now
|
||||
from django.conf import settings
|
||||
|
||||
from pretixbase.models import Event, Organizer
|
||||
from pretixbase.plugins import get_all_plugins
|
||||
from pretixbase.signals import determine_availability
|
||||
from pretix.base.models import Event, Organizer
|
||||
from pretix.base.plugins import get_all_plugins
|
||||
from pretix.base.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 = 'pretixplugins.testdummy'
|
||||
self.event.plugins = 'pretix.plugins.testdummy'
|
||||
self.event.save()
|
||||
payload = {'foo': 'bar'}
|
||||
responses = determine_availability.send(self.event, **payload)
|
||||
self.assertEqual(len(responses), 1)
|
||||
self.assertIn('pretixplugins.testdummy.signals', [r[0].__module__ for r in responses])
|
||||
self.assertIn('pretix.plugins.testdummy.signals', [r[0].__module__ for r in responses])
|
||||
@@ -0,0 +1,8 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class PretixControlConfig(AppConfig):
|
||||
name = 'pretix.control'
|
||||
label = 'pretixcontrol'
|
||||
|
||||
default_app_config = 'pretix.control.PretixControlConfig'
|
||||
@@ -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 pretixbase.models import Event
|
||||
from pretix.base.models import Event
|
||||
|
||||
|
||||
class PermissionMiddleware:
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.http import HttpResponseForbidden
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from pretixbase.models import EventPermission
|
||||
from pretix.base.models import EventPermission
|
||||
|
||||
|
||||
def event_permission_required(permission):
|
||||
@@ -1,4 +1,4 @@
|
||||
from pretixbase.signals import EventPluginSignal
|
||||
from pretix.base.signals import EventPluginSignal
|
||||
|
||||
|
||||
"""
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "../../../../pretixbase/static/bootstrap/less/bootstrap.less";
|
||||
@import "../../../../base/static/bootstrap/less/bootstrap.less";
|
||||
|
||||
body {
|
||||
background: #eee;
|
||||
@@ -0,0 +1,4 @@
|
||||
@import "../../../../base/static/bootstrap/less/bootstrap.less";
|
||||
@import "../../../../base/static/fontawesome/less/font-awesome.less";
|
||||
@fa-font-path: "../../fontawesome/fonts";
|
||||
@import "forms.less";
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.test import TestCase, Client
|
||||
|
||||
from pretixbase.models import User
|
||||
from pretixbase.tests import BrowserTest, on_platforms
|
||||
from pretix.base.models import User
|
||||
from pretix.base.tests import BrowserTest, on_platforms
|
||||
|
||||
|
||||
@on_platforms()
|
||||
@@ -1,6 +1,6 @@
|
||||
import datetime
|
||||
from pretixbase.models import User, Organizer, Event, OrganizerPermission, EventPermission
|
||||
from pretixbase.tests import BrowserTest, on_platforms
|
||||
from pretix.base.models import User, Organizer, Event, OrganizerPermission, EventPermission
|
||||
from pretix.base.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: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)
|
||||
self.assertIn("Enable", self.driver.find_element_by_name("plugin:pretix.plugins.timerestriction").text)
|
||||
self.driver.find_element_by_name("plugin:pretix.plugins.timerestriction").click()
|
||||
self.assertIn("Disable", self.driver.find_element_by_name("plugin:pretix.plugins.timerestriction").text)
|
||||
self.driver.find_element_by_name("plugin:pretix.plugins.timerestriction").click()
|
||||
self.assertIn("Enable", self.driver.find_element_by_name("plugin:pretix.plugins.timerestriction").text)
|
||||
@@ -3,9 +3,9 @@ import time
|
||||
import datetime
|
||||
from django.utils import unittest
|
||||
from selenium.webdriver.support.select import Select
|
||||
from pretixbase.models import User, Organizer, Event, OrganizerPermission, EventPermission, ItemCategory, Property, \
|
||||
from pretix.base.models import User, Organizer, Event, OrganizerPermission, EventPermission, ItemCategory, Property, \
|
||||
PropertyValue, Question, Quota, Item
|
||||
from pretixbase.tests import BrowserTest, on_platforms
|
||||
from pretix.base.tests import BrowserTest, on_platforms
|
||||
|
||||
|
||||
class ItemFormTest(BrowserTest):
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
from django.test import TestCase, Client
|
||||
from django.utils.timezone import now
|
||||
|
||||
from pretixbase.models import Event, Organizer, User, EventPermission
|
||||
from pretix.base.models import Event, Organizer, User, EventPermission
|
||||
|
||||
|
||||
class PermissionMiddlewareTest(TestCase):
|
||||
@@ -1,22 +1,22 @@
|
||||
from django.conf.urls import patterns, url, include
|
||||
from pretixcontrol.views import main, event, item
|
||||
from pretix.control.views import main, event, item
|
||||
|
||||
urlpatterns = patterns('',)
|
||||
urlpatterns += patterns(
|
||||
'pretixcontrol.views.auth',
|
||||
'pretix.control.views.auth',
|
||||
url(r'^logout$', 'logout', name='auth.logout'),
|
||||
url(r'^login$', 'login', name='auth.login'),
|
||||
)
|
||||
urlpatterns += patterns(
|
||||
'pretixcontrol.views.main',
|
||||
'pretix.control.views.main',
|
||||
url(r'^$', 'index', name='index'),
|
||||
url(r'^events/$', main.EventList.as_view(), name='events'),
|
||||
)
|
||||
urlpatterns += patterns(
|
||||
'pretixcontrol.views.event',
|
||||
'pretix.control.views.event',
|
||||
url(r'^event/(?P<organizer>[^/]+)/(?P<event>[^/]+)/', include(
|
||||
patterns(
|
||||
'pretixcontrol.views',
|
||||
'pretix.control.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'),
|
||||
@@ -7,10 +7,10 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from pytz import common_timezones
|
||||
from pretixbase.forms import VersionedModelForm
|
||||
from pretix.base.forms import VersionedModelForm
|
||||
|
||||
from pretixbase.models import Event
|
||||
from pretixcontrol.permissions import EventPermissionRequiredMixin
|
||||
from pretix.base.models import Event
|
||||
from pretix.control.permissions import EventPermissionRequiredMixin
|
||||
|
||||
|
||||
class EventUpdateForm(VersionedModelForm):
|
||||
@@ -75,7 +75,7 @@ class EventPlugins(EventPermissionRequiredMixin, TemplateView, SingleObjectMixin
|
||||
return self.request.event
|
||||
|
||||
def get_context_data(self, *args, **kwargs) -> dict:
|
||||
from pretixbase.plugins import get_all_plugins
|
||||
from pretix.base.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()
|
||||
@@ -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 pretixbase.forms import VersionedModelForm
|
||||
from pretix.base.forms import VersionedModelForm
|
||||
|
||||
from pretixbase.models import ItemVariation, PropertyValue, Item
|
||||
from pretix.base.models import ItemVariation, PropertyValue, Item
|
||||
|
||||
|
||||
class TolerantFormsetModelForm(VersionedModelForm):
|
||||
@@ -12,14 +12,14 @@ 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 pretixbase.forms import VersionedModelForm
|
||||
from pretix.base.forms import VersionedModelForm
|
||||
|
||||
from pretixbase.models import (
|
||||
from pretix.base.models import (
|
||||
Item, ItemCategory, Property, ItemVariation, PropertyValue, Question, Quota,
|
||||
Versionable)
|
||||
from pretixcontrol.permissions import EventPermissionRequiredMixin, event_permission_required
|
||||
from pretixcontrol.views.forms import TolerantFormsetModelForm, VariationsField
|
||||
from pretixcontrol.signals import restriction_formset
|
||||
from pretix.control.permissions import EventPermissionRequiredMixin, event_permission_required
|
||||
from pretix.control.views.forms import TolerantFormsetModelForm, VariationsField
|
||||
from pretix.control.signals import restriction_formset
|
||||
|
||||
|
||||
class ItemList(ListView):
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.shortcuts import render
|
||||
from django.views.generic import ListView
|
||||
|
||||
from pretixbase.models import Event
|
||||
from pretix.base.models import Event
|
||||
|
||||
|
||||
class EventList(ListView):
|
||||
@@ -1,12 +1,12 @@
|
||||
from django.apps import AppConfig
|
||||
from pretixbase.plugins import PluginType
|
||||
from pretix.base.plugins import PluginType
|
||||
|
||||
|
||||
class TestDummyApp(AppConfig):
|
||||
name = 'pretixplugins.testdummy'
|
||||
name = 'pretix.plugins.testdummy'
|
||||
verbose_name = '.testdummy'
|
||||
|
||||
class TixlPluginMeta:
|
||||
class PretixPluginMeta:
|
||||
type = PluginType.RESTRICTION
|
||||
name = '.testdummy'
|
||||
version = '1.0.0'
|
||||
@@ -14,4 +14,4 @@ class TestDummyApp(AppConfig):
|
||||
def ready(self):
|
||||
from . import signals # NOQA
|
||||
|
||||
default_app_config = 'pretixplugins.testdummy.TestDummyApp'
|
||||
default_app_config = 'pretix.plugins.testdummy.TestDummyApp'
|
||||
@@ -1,6 +1,6 @@
|
||||
from django.dispatch import receiver
|
||||
|
||||
from pretixbase.signals import determine_availability
|
||||
from pretix.base.signals import determine_availability
|
||||
|
||||
|
||||
@receiver(determine_availability)
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
from django.apps import AppConfig
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from pretixbase.plugins import PluginType
|
||||
from pretix.base.plugins import PluginType
|
||||
|
||||
|
||||
class TimeRestrictionApp(AppConfig):
|
||||
name = 'pretixplugins.timerestriction'
|
||||
name = 'pretix.plugins.timerestriction'
|
||||
verbose_name = _("Time restriction")
|
||||
|
||||
class TixlPluginMeta:
|
||||
class PretixPluginMeta:
|
||||
type = PluginType.RESTRICTION
|
||||
name = _("Restriction by time")
|
||||
author = _("the pretix team")
|
||||
@@ -19,4 +19,4 @@ class TimeRestrictionApp(AppConfig):
|
||||
def ready(self):
|
||||
from . import signals # NOQA
|
||||
|
||||
default_app_config = 'pretixplugins.timerestriction.TimeRestrictionApp'
|
||||
default_app_config = 'pretix.plugins.timerestriction.TimeRestrictionApp'
|
||||
+3
-2
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import pretixbase.models
|
||||
import pretix.base.models
|
||||
import versions.models
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ class Migration(migrations.Migration):
|
||||
('price', models.DecimalField(null=True, blank=True, verbose_name='Price in time frame', max_digits=7, decimal_places=2)),
|
||||
('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')),
|
||||
('variations', pretix.base.models.VariationsField(to='pretixbase.ItemVariation', blank=True,
|
||||
verbose_name='Variations', related_name='restrictions_timerestriction_timerestriction')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Restriction',
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from pretixbase.models import BaseRestriction
|
||||
from pretix.base.models import BaseRestriction
|
||||
|
||||
|
||||
class TimeRestriction(BaseRestriction):
|
||||
+4
-4
@@ -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 pretixbase.signals import determine_availability
|
||||
from pretixbase.models import Item
|
||||
from pretixcontrol.views.forms import RestrictionInlineFormset, RestrictionForm
|
||||
from pretixcontrol.signals import restriction_formset
|
||||
from pretix.base.signals import determine_availability
|
||||
from pretix.base.models import Item
|
||||
from pretix.control.views.forms import RestrictionInlineFormset, RestrictionForm
|
||||
from pretix.control.signals import restriction_formset
|
||||
|
||||
from .models import TimeRestriction
|
||||
|
||||
+3
-3
@@ -3,13 +3,13 @@ from datetime import timedelta
|
||||
from django.test import TestCase
|
||||
from django.utils.timezone import now
|
||||
|
||||
from pretixbase.models import (
|
||||
from pretix.base.models import (
|
||||
Event, Organizer, Item, Property, PropertyValue, ItemVariation
|
||||
)
|
||||
|
||||
# Do NOT use relative imports here
|
||||
from pretixplugins.timerestriction import signals
|
||||
from pretixplugins.timerestriction.models import TimeRestriction
|
||||
from pretix.plugins.timerestriction import signals
|
||||
from pretix.plugins.timerestriction.models import TimeRestriction
|
||||
|
||||
|
||||
class TimeRestrictionTest(TestCase):
|
||||
@@ -0,0 +1,8 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class PretixPresaleConfig(AppConfig):
|
||||
name = 'pretix.presale'
|
||||
label = 'pretixpresale'
|
||||
|
||||
default_app_config = 'pretix.presale.PretixPresaleConfig'
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.core.urlresolvers import resolve
|
||||
from django.http import HttpResponseNotFound
|
||||
|
||||
from pretixbase.models import Event
|
||||
from pretix.base.models import Event
|
||||
|
||||
|
||||
class EventMiddleware:
|
||||
@@ -0,0 +1,5 @@
|
||||
@import "../../../../base/static/bootstrap/less/bootstrap.less";
|
||||
@import "../../../../base/static/fontawesome/less/font-awesome.less";
|
||||
@fa-font-path: "../../fontawesome/fonts";
|
||||
|
||||
@import "event.less";
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user