forked from beba/foerderbarometer
				
			unfied CHOICES into one global list
This commit is contained in:
		
							parent
							
								
									58924235ff
								
							
						
					
					
						commit
						7d38549c3d
					
				| 
						 | 
					@ -2,7 +2,7 @@ from django.db import models
 | 
				
			||||||
from django.forms import ModelForm, DateField, ChoiceField, RadioSelect
 | 
					from django.forms import ModelForm, DateField, ChoiceField, RadioSelect
 | 
				
			||||||
from django.contrib.admin.widgets import AdminDateWidget
 | 
					from django.contrib.admin.widgets import AdminDateWidget
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from .models import Project, Volunteer, IFG, Library
 | 
					from .models import Project, Volunteer, IFG, Library, TYPE_CHOICES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ProjectForm(ModelForm):
 | 
					class ProjectForm(ModelForm):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,13 +15,7 @@ class ProjectForm(ModelForm):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class VolunteerForm(ModelForm):
 | 
					class VolunteerForm(ModelForm):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    CHOICES = [('BIB', 'Bibliotheksstipendium'),
 | 
					    choice = ChoiceField(choices=TYPE_CHOICES, widget=RadioSelect)
 | 
				
			||||||
               ('ELIT', 'eLiteraturstipendium'),
 | 
					 | 
				
			||||||
               ('SOFT', 'Softwarestipendium'),
 | 
					 | 
				
			||||||
               ('VIS', 'Visitenkarten, Mailingliste oder E-Mail-Adresse'),
 | 
					 | 
				
			||||||
               ('IFG', 'Kostenübernahme IFG-Anfrage'),
 | 
					 | 
				
			||||||
               ('LIT', 'Literaturstipendium'),]
 | 
					 | 
				
			||||||
    choice = ChoiceField(choices=CHOICES, widget=RadioSelect)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    class Meta:
 | 
					    class Meta:
 | 
				
			||||||
        model = Volunteer
 | 
					        model = Volunteer
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,7 +42,10 @@ class Grant(Volunteer):
 | 
				
			||||||
# same model is used for Library, ELitStip and Software!
 | 
					# same model is used for Library, ELitStip and Software!
 | 
				
			||||||
TYPE_CHOICES = [('BIB', 'Bibliotheksstipendium'),
 | 
					TYPE_CHOICES = [('BIB', 'Bibliotheksstipendium'),
 | 
				
			||||||
           ('ELIT', 'eLiteraturstipendium'),
 | 
					           ('ELIT', 'eLiteraturstipendium'),
 | 
				
			||||||
                ('SOFT', 'Softwarestipendium')]
 | 
					           ('SOFT', 'Softwarestipendium'),
 | 
				
			||||||
 | 
					           ('VIS', 'Visitenkarten, Mailingliste oder E-Mail-Adresse'),
 | 
				
			||||||
 | 
					           ('IFG', 'Kostenübernahme IFG-Anfrage'),
 | 
				
			||||||
 | 
					           ('LIT', 'Literaturstipendium'),]
 | 
				
			||||||
           
 | 
					           
 | 
				
			||||||
class Library(Grant):
 | 
					class Library(Grant):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue