Add a kind of trashbin for registrations and participants
All checks were successful
buildbot/tox Build done.
All checks were successful
buildbot/tox Build done.
This commit is contained in:
26
dav_events/models/trash/trashed_participant.py
Normal file
26
dav_events/models/trash/trashed_participant.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- 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')
|
||||
created_at = models.DateTimeField()
|
||||
trashed_at = models.DateTimeField(auto_now_add=True)
|
||||
position = models.IntegerField(verbose_name='Listennummer')
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Gelöschter Teilnehmer (Papierkorb)')
|
||||
verbose_name_plural = _('Gelöschte Teilnehmer (Papierkorb)')
|
||||
ordering = ['event', 'trashed_at']
|
||||
|
||||
def __str__(self):
|
||||
return '{eventnumber} - {name}'.format(
|
||||
eventnumber=self.event.get_number(),
|
||||
name=self.get_full_name(),
|
||||
)
|
||||
Reference in New Issue
Block a user