from django.db import models from admin_ordering.models import OrderableModel # Create your models here. class AttachmentModel(models.Model): year = models.IntegerField('Rok', blank=True, null=True) title = models.CharField('Tytuł', max_length=250) created_at = models.DateTimeField(auto_now_add=True) def __str__(self): return self.title class Meta: abstract = True ordering = ['-created_at'] class AdministrationStatute(AttachmentModel): attachment = models.FileField('Plik pdf', upload_to='statutes') class Meta: verbose_name = 'Statut' verbose_name_plural = 'Statuty' class AdministrationAnnouncement(AttachmentModel): attachment = models.FileField('Plik pdf', upload_to='announcements') class Meta: verbose_name = 'Ogłoszenie' verbose_name_plural = 'Ogłoszenia' class AdministrationProtocol(AttachmentModel): attachment = models.FileField('Plik pdf', upload_to='protocols') class Meta: verbose_name = 'Protokół / Uchwała' verbose_name_plural = 'Protokoły / Uchwały' class AdministrationRegulation(AttachmentModel): attachment = models.FileField('Plik pdf', upload_to='regulations') class Meta: verbose_name = 'Regulamin' verbose_name_plural = 'Regulaminy' class AdministrationMember(OrderableModel): name = models.CharField('Imię i nazwisko', max_length=512) contact = models.CharField('Dane kontaktowe', max_length=512) function = models.CharField('Funkcja', max_length=512) def __str__(self): return f'{self.function} - {self.name}' class Meta(OrderableModel.Meta): verbose_name = 'Członek' verbose_name_plural = 'Członkowie' class RODO(models.Model): who = models.CharField( 'Przez kogo przetwarzane dane osobowe?', max_length=512) attachment = models.FileField('Plik pdf', upload_to='rodo') def __str__(self): return f'RODO - {self.who}' class Meta: verbose_name = 'Dokument RODO' verbose_name_plural = 'Dokumenty RODO'