From 6091fe3fe4e3af31742c340cfc8a654861ec832d Mon Sep 17 00:00:00 2001 From: Sanj Date: Tue, 4 Sep 2012 03:22:36 +0530 Subject: [PATCH] fix typo, make languages checkbox in production form --- itf/itfprofiles/forms.py | 1 + itf/itfprofiles/models.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/itf/itfprofiles/forms.py b/itf/itfprofiles/forms.py index 5fe7ff4..3e9cde6 100644 --- a/itf/itfprofiles/forms.py +++ b/itf/itfprofiles/forms.py @@ -196,6 +196,7 @@ PersonProductionInline = itf_inlineformset_factory(Production, PersonProduction, class ProductionForm(ItfForm): inlines = [PersonProductionInline, AwardsInline] script = forms.ModelChoiceField(Script.objects.all(), widget=AutocompleteAddWidget(model_class=Script)) + languages = forms.ModelMultipleChoiceField(Language.objects.all(), widget=forms.CheckboxSelectMultiple()) director = forms.ModelChoiceField(Person.objects.all(), widget=AutocompleteAddWidget(model_class=Person)) playwright = forms.ModelChoiceField(Person.objects.all(), widget=AutocompleteAddWidget(model_class=Person)) group = forms.ModelChoiceField(TheatreGroup.objects.all(), widget=AutocompleteAddWidget(model_class=TheatreGroup)) diff --git a/itf/itfprofiles/models.py b/itf/itfprofiles/models.py index 76c5d59..3a9a28f 100644 --- a/itf/itfprofiles/models.py +++ b/itf/itfprofiles/models.py @@ -330,7 +330,7 @@ class Production(ItfModel): def get_dict(self): rel_level1 = [obj for obj in Production.objects.filter(script= self.script)] - rel_level2 = list(set(obj.productions_set.all() for obj in self.related_scripts.all())) + rel_level2 = list(set(obj.productions_set.all() for obj in self.script.related_scripts.all())) return { 'name': self.name,