Commit 7bb61658cf3505fd1c097a46d123941f57aa0394

Authored by Gustavo Bernardo
1 parent 22c2915e

Included the option to select students in create and update subject. [Issue:#411]

Showing 1 changed file with 5 additions and 5 deletions   Show diff stats
courses/forms.py
@@ -20,7 +20,7 @@ class CategoryCourseForm(forms.ModelForm): @@ -20,7 +20,7 @@ class CategoryCourseForm(forms.ModelForm):
20 } 20 }
21 21
22 class CourseForm(forms.ModelForm): 22 class CourseForm(forms.ModelForm):
23 - 23 +
24 class Meta: 24 class Meta:
25 model = Course 25 model = Course
26 fields = ('name', 'category', 'coordenator','public') 26 fields = ('name', 'category', 'coordenator','public')
@@ -73,9 +73,9 @@ class SubjectForm(forms.ModelForm): @@ -73,9 +73,9 @@ class SubjectForm(forms.ModelForm):
73 return end_date 73 return end_date
74 74
75 class Meta: 75 class Meta:
76 - 76 +
77 model = Subject 77 model = Subject
78 - fields = ('name', 'description','init_date', 'end_date', 'visible',) 78 + fields = ('name', 'description','init_date', 'end_date', 'visible','students',)
79 localized_fields = ('init_date', 'end_date',) 79 localized_fields = ('init_date', 'end_date',)
80 labels = { 80 labels = {
81 'name': _('Name'), 81 'name': _('Name'),
@@ -83,6 +83,7 @@ class SubjectForm(forms.ModelForm): @@ -83,6 +83,7 @@ class SubjectForm(forms.ModelForm):
83 'init_date': _('Start date'), 83 'init_date': _('Start date'),
84 'end_date': _('End date'), 84 'end_date': _('End date'),
85 'visible': _('Is it visible?'), 85 'visible': _('Is it visible?'),
  86 + 'students': _('Students')
86 } 87 }
87 help_texts = { 88 help_texts = {
88 'name': _("Subjects's name"), 89 'name': _("Subjects's name"),
@@ -90,6 +91,7 @@ class SubjectForm(forms.ModelForm): @@ -90,6 +91,7 @@ class SubjectForm(forms.ModelForm):
90 'init_date': _('Start date of the subject'), 91 'init_date': _('Start date of the subject'),
91 'end_date': _('End date of the subject'), 92 'end_date': _('End date of the subject'),
92 'visible': _('Is the subject visible?'), 93 'visible': _('Is the subject visible?'),
  94 + 'students': _('The students that can participate in this subject. Hold down the "Control", or "Command" on the Mac, to select more than one option.')
93 } 95 }
94 widgets = { 96 widgets = {
95 'description':SummernoteWidget(), 97 'description':SummernoteWidget(),
@@ -156,5 +158,3 @@ class LinkMaterialForm(forms.ModelForm): @@ -156,5 +158,3 @@ class LinkMaterialForm(forms.ModelForm):
156 class Meta: 158 class Meta:
157 model = LinkMaterial 159 model = LinkMaterial
158 fields = ['material', 'name', 'description','url'] 160 fields = ['material', 'name', 'description','url']
159 -  
160 -