Files
django-dav-events/dav_events/models/trash/trashed_participant.py
heinzel 94595f4785
All checks were successful
buildbot/tox Build done.
Add a kind of trashbin for registrations and participants
2020-12-03 11:47:41 +01:00

27 lines
937 B
Python

# -*- 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(),
)