Add SubEvent.last_modified

This commit is contained in:
Raphael Michel
2020-10-15 18:32:10 +02:00
parent b4a7729cb5
commit bf59ce2661
7 changed files with 52 additions and 14 deletions

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.0.9 on 2020-10-15 16:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pretixbase', '0163_device_security_profile'),
]
operations = [
migrations.AddField(
model_name='subevent',
name='last_modified',
field=models.DateTimeField(auto_now=True, db_index=True),
),
]

View File

@@ -1036,6 +1036,9 @@ class SubEvent(EventMixin, LoggedModel):
)
seating_plan = models.ForeignKey('SeatingPlan', on_delete=models.PROTECT, null=True, blank=True,
related_name='subevents')
last_modified = models.DateTimeField(
auto_now=True, db_index=True
)
items = models.ManyToManyField('Item', through='SubEventItem')
variations = models.ManyToManyField('ItemVariation', through='SubEventItemVariation')

View File

@@ -18,8 +18,9 @@ from i18nfield.strings import LazyI18nString
from pretix.base.channels import get_all_sales_channels
from pretix.base.forms.questions import guess_country
from pretix.base.models import (
ItemVariation, OrderPosition, QuestionAnswer, QuestionOption, Seat,
Question)
ItemVariation, OrderPosition, Question, QuestionAnswer, QuestionOption,
Seat,
)
from pretix.base.services.pricing import get_price
from pretix.base.settings import (
COUNTRIES_WITH_STATE_IN_ADDRESS, PERSON_NAME_SCHEMES,