set explicit library type choices

This commit is contained in:
Oliver Zander 2025-08-20 11:19:05 +02:00 committed by Tobias Herre
parent d40c53bc80
commit 60a5538033
1 changed files with 3 additions and 1 deletions

View File

@ -274,13 +274,15 @@ TYPE_CHOICES = {
TYPE_VIS: type_link('E-Mail-Adressen_und_Visitenkarten#Visitenkarten', 'Visitenkarten'), TYPE_VIS: type_link('E-Mail-Adressen_und_Visitenkarten#Visitenkarten', 'Visitenkarten'),
} }
LIBRARY_TYPES = TYPE_BIB, TYPE_ELIT, TYPE_SOFT
LIBRARY_TYPE_CHOICES = [(choice, TYPE_CHOICES[choice]) for choice in LIBRARY_TYPES]
# same model is used for Library, ELitStip and Software! # same model is used for Library, ELitStip and Software!
class Library(Grant): class Library(Grant):
type = models.CharField( type = models.CharField(
max_length=4, max_length=4,
choices=TYPE_CHOICES.items(), #attention: actually only BIB, ELIT, SOFT should be used here choices=LIBRARY_TYPE_CHOICES,
default='BIB', default='BIB',
) )
library = models.CharField(max_length=200) library = models.CharField(max_length=200)