add stage2 app (with participant view mostly ready)
[edumed.git] / stage2 / forms.py
1 # -*- coding: utf-8 -*-
2 from django import forms
3
4 from stage2.models import Attachment
5
6
7 class AttachmentForm(forms.ModelForm):
8     class Meta:
9         model = Attachment
10         fields = ['file']
11
12     def __init__(self, assignment, file_no, label, *args, **kwargs):
13         prefix = 'att%s-%s' % (assignment.id, file_no)
14         super(AttachmentForm, self).__init__(*args, prefix=prefix, **kwargs)
15         self.fields['file'].label = label