2017-02-21 11:07:36 +01:00
|
|
|
from django.db import models
|
2017-07-18 19:08:09 +02:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2017-02-21 11:07:36 +01:00
|
|
|
|
2017-07-18 19:08:09 +02:00
|
|
|
|
|
|
|
class EventSpecificMixin(models.Model):
|
|
|
|
"""Mixin allowing for event-specific models instances
|
|
|
|
or not (depending on whether the event field is null)"""
|
|
|
|
|
|
|
|
event = models.ForeignKey(
|
|
|
|
'event.Event',
|
|
|
|
verbose_name=_("évènement"),
|
|
|
|
help_text=_("Si spécifié, l'instance du modèle"
|
|
|
|
"est spécifique à l'évènement en question"),
|
2018-08-27 00:02:33 +02:00
|
|
|
on_delete=models.CASCADE,
|
2017-07-18 19:08:09 +02:00
|
|
|
blank=True,
|
|
|
|
null=True
|
|
|
|
)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|