forked from CGM_Public/pretix_original
Integrate the names of attendees into the core database layout
This commit is contained in:
49
src/pretix/base/migrations/0011_auto_20150304_1030.py
Normal file
49
src/pretix/base/migrations/0011_auto_20150304_1030.py
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import models, migrations
|
||||||
|
import versions.models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('pretixbase', '0010_auto_20150218_2048'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='orderposition',
|
||||||
|
name='answers',
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='cartposition',
|
||||||
|
name='attendee_name',
|
||||||
|
field=models.CharField(max_length=255, blank=True, null=True, verbose_name='Attendee name', help_text='Empty, if this item is not an admission ticket'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='item',
|
||||||
|
name='admission',
|
||||||
|
field=models.BooleanField(verbose_name='Is a admission ticket', default=False, help_text='Whether or not this item allows a person to enter your event'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='orderposition',
|
||||||
|
name='attendee_name',
|
||||||
|
field=models.CharField(max_length=255, blank=True, null=True, verbose_name='Attendee name', help_text='Empty, if this item is not an admission ticket'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='questionanswer',
|
||||||
|
name='cartposition',
|
||||||
|
field=models.ForeignKey(blank=True, to='pretixbase.CartPosition', null=True, related_name='answers'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='questionanswer',
|
||||||
|
name='orderposition',
|
||||||
|
field=models.ForeignKey(blank=True, to='pretixbase.OrderPosition', null=True, related_name='answers'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='questionanswer',
|
||||||
|
name='question',
|
||||||
|
field=versions.models.VersionedForeignKey(related_name='answers', to='pretixbase.Question'),
|
||||||
|
),
|
||||||
|
]
|
||||||
19
src/pretix/base/migrations/0012_auto_20150304_1038.py
Normal file
19
src/pretix/base/migrations/0012_auto_20150304_1038.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import models, migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('pretixbase', '0011_auto_20150304_1030'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='item',
|
||||||
|
name='admission',
|
||||||
|
field=models.BooleanField(verbose_name='Is an admission ticket', help_text='Whether or not this item allows a person to enter your event', default=False),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -769,8 +769,8 @@ class Item(Versionable):
|
|||||||
blank=True,
|
blank=True,
|
||||||
help_text=_(
|
help_text=_(
|
||||||
'The selected properties will be available for the user '
|
'The selected properties will be available for the user '
|
||||||
+ 'to select. After saving this field, move to the '
|
'to select. After saving this field, move to the '
|
||||||
+ '\'Variations\' tab to configure the details.'
|
'\'Variations\' tab to configure the details.'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
questions = VersionedManyToManyField(
|
questions = VersionedManyToManyField(
|
||||||
@@ -780,9 +780,17 @@ class Item(Versionable):
|
|||||||
blank=True,
|
blank=True,
|
||||||
help_text=_(
|
help_text=_(
|
||||||
'The user will be asked to fill in answers for the '
|
'The user will be asked to fill in answers for the '
|
||||||
+ 'selected questions'
|
'selected questions'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
admission = models.BooleanField(
|
||||||
|
verbose_name=_("Is an admission ticket"),
|
||||||
|
help_text=_(
|
||||||
|
'Whether or not this item allows a person to enter '
|
||||||
|
'your event'
|
||||||
|
),
|
||||||
|
default=False
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _("Item")
|
verbose_name = _("Item")
|
||||||
@@ -1364,9 +1372,17 @@ class QuestionAnswer(Versionable):
|
|||||||
"""
|
"""
|
||||||
The answer to a Question, connected to an OrderPosition or CartPosition
|
The answer to a Question, connected to an OrderPosition or CartPosition
|
||||||
"""
|
"""
|
||||||
orderposition = models.ForeignKey('OrderPosition', null=True, blank=True)
|
orderposition = models.ForeignKey(
|
||||||
cartposition = models.ForeignKey('CartPosition', null=True, blank=True)
|
'OrderPosition', null=True, blank=True,
|
||||||
question = VersionedForeignKey(Question)
|
related_name='answers'
|
||||||
|
)
|
||||||
|
cartposition = models.ForeignKey(
|
||||||
|
'CartPosition', null=True, blank=True,
|
||||||
|
related_name='answers'
|
||||||
|
)
|
||||||
|
question = VersionedForeignKey(
|
||||||
|
Question, related_name='answers'
|
||||||
|
)
|
||||||
answer = models.TextField()
|
answer = models.TextField()
|
||||||
|
|
||||||
|
|
||||||
@@ -1395,10 +1411,11 @@ class OrderPosition(Versionable):
|
|||||||
decimal_places=2, max_digits=10,
|
decimal_places=2, max_digits=10,
|
||||||
verbose_name=_("Price")
|
verbose_name=_("Price")
|
||||||
)
|
)
|
||||||
answers = VersionedManyToManyField(
|
attendee_name = models.CharField(
|
||||||
Question,
|
max_length=255,
|
||||||
through=QuestionAnswer,
|
verbose_name=_("Attendee name"),
|
||||||
verbose_name=_("Answers")
|
blank=True, null=True,
|
||||||
|
help_text=_("Empty, if this item is not an admission ticket")
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
@@ -1443,6 +1460,12 @@ class CartPosition(Versionable):
|
|||||||
expires = models.DateTimeField(
|
expires = models.DateTimeField(
|
||||||
verbose_name=_("Expiration date")
|
verbose_name=_("Expiration date")
|
||||||
)
|
)
|
||||||
|
attendee_name = models.CharField(
|
||||||
|
max_length=255,
|
||||||
|
verbose_name=_("Attendee name"),
|
||||||
|
blank=True, null=True,
|
||||||
|
help_text=_("Empty, if this item is not an admission ticket")
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _("Cart position")
|
verbose_name = _("Cart position")
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
{% bootstrap_field form.name layout="horizontal" %}
|
{% bootstrap_field form.name layout="horizontal" %}
|
||||||
{% bootstrap_field form.active layout="horizontal" %}
|
{% bootstrap_field form.active layout="horizontal" %}
|
||||||
{% bootstrap_field form.category layout="horizontal" %}
|
{% bootstrap_field form.category layout="horizontal" %}
|
||||||
|
{% bootstrap_field form.admission layout="horizontal" %}
|
||||||
{% bootstrap_field form.short_description layout="horizontal" %}
|
{% bootstrap_field form.short_description layout="horizontal" %}
|
||||||
{% bootstrap_field form.long_description layout="horizontal" %}
|
{% bootstrap_field form.long_description layout="horizontal" %}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|||||||
@@ -629,6 +629,7 @@ class ItemFormGeneral(VersionedModelForm):
|
|||||||
'category',
|
'category',
|
||||||
'name',
|
'name',
|
||||||
'active',
|
'active',
|
||||||
|
'admission',
|
||||||
'short_description',
|
'short_description',
|
||||||
'long_description',
|
'long_description',
|
||||||
'default_price',
|
'default_price',
|
||||||
|
|||||||
Reference in New Issue
Block a user