This commit is contained in:
@@ -10,10 +10,9 @@ import unicodedata
|
||||
from babel.dates import format_date
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.db import models
|
||||
from django.template.loader import get_template
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.translation import get_language, ugettext_lazy as _
|
||||
from django_countries.fields import Country, CountryField
|
||||
|
||||
@@ -27,7 +26,6 @@ from .eventchange import EventChange
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Event(models.Model):
|
||||
# Metadata
|
||||
owner = models.ForeignKey(settings.AUTH_USER_MODEL,
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from . import get_ghost_user, get_system_user
|
||||
|
||||
@@ -12,7 +11,6 @@ def get_system_user_id():
|
||||
return get_system_user().id
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class EventChange(models.Model):
|
||||
UPDATE = 'update'
|
||||
RAISE_FLAG = 'set_flag'
|
||||
@@ -23,7 +21,7 @@ class EventChange(models.Model):
|
||||
(LOWER_FLAG, 'Lower Flag'),
|
||||
)
|
||||
|
||||
event = models.ForeignKey('dav_events.Event', related_name='changes')
|
||||
event = models.ForeignKey('dav_events.Event', related_name='changes', on_delete=models.CASCADE)
|
||||
timestamp = models.DateTimeField(default=timezone.now)
|
||||
user = models.ForeignKey(settings.AUTH_USER_MODEL,
|
||||
default=get_system_user_id,
|
||||
|
||||
@@ -2,7 +2,6 @@ from __future__ import unicode_literals
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from . import get_ghost_user, get_system_user
|
||||
|
||||
@@ -11,9 +10,8 @@ def get_system_user_id():
|
||||
return get_system_user().id
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class EventFlag(models.Model):
|
||||
event = models.ForeignKey('dav_events.Event', related_name='flags')
|
||||
event = models.ForeignKey('dav_events.Event', related_name='flags', on_delete=models.CASCADE)
|
||||
status = models.ForeignKey('dav_events.EventStatus',
|
||||
on_delete=models.PROTECT,
|
||||
related_name='+')
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from ..validators import IdStringValidator
|
||||
@@ -22,7 +21,6 @@ BOOTSTRAP_CONTEXT_CHOICES = (
|
||||
)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class EventStatus(models.Model):
|
||||
code = models.CharField(primary_key=True, max_length=254, validators=[IdStringValidator])
|
||||
severity = models.IntegerField(unique=True)
|
||||
|
||||
@@ -3,10 +3,9 @@ from __future__ import unicode_literals
|
||||
import logging
|
||||
import uuid
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.translation import ugettext, ugettext_lazy as _
|
||||
|
||||
from .event import Event
|
||||
@@ -14,7 +13,6 @@ from .event import Event
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class OneClickAction(models.Model):
|
||||
COMMANDS = (
|
||||
('EVENT_LIST', 'login and go to event list (user id)'),
|
||||
|
||||
@@ -4,7 +4,6 @@ import datetime
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from dav_base.validators import DAVNumberValidator
|
||||
@@ -12,7 +11,6 @@ from dav_base.validators import DAVNumberValidator
|
||||
midnight = datetime.time(00, 00, 00)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class AbstractParticipant(models.Model):
|
||||
personal_names = models.CharField(max_length=1024,
|
||||
verbose_name=_('Vorname(n)'))
|
||||
@@ -158,9 +156,8 @@ class AbstractParticipant(models.Model):
|
||||
return timezone.make_aware(datetime.datetime.combine(purge_date, midnight))
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Participant(AbstractParticipant):
|
||||
event = models.ForeignKey('Event', related_name='participants')
|
||||
event = models.ForeignKey('Event', related_name='participants', on_delete=models.PROTECT)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
position = models.IntegerField(verbose_name='Listennummer')
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from ..participant import AbstractParticipant
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class TrashedParticipant(AbstractParticipant):
|
||||
event = models.ForeignKey('Event', related_name='trashed_participants')
|
||||
event = models.ForeignKey('Event', related_name='trashed_participants', on_delete=models.CASCADE)
|
||||
created_at = models.DateTimeField()
|
||||
trashed_at = models.DateTimeField(auto_now_add=True)
|
||||
position = models.IntegerField(verbose_name='Listennummer')
|
||||
|
||||
Reference in New Issue
Block a user