summaryrefslogtreecommitdiff
path: root/grades/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'grades/forms.py')
-rw-r--r--grades/forms.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/grades/forms.py b/grades/forms.py
new file mode 100644
index 0000000..f8c800a
--- /dev/null
+++ b/grades/forms.py
@@ -0,0 +1,13 @@
+from grades.models import GradingSystem
+from django import forms
+
+class GradingSystemForm(forms.ModelForm):
+ def __init__(self, *args, ** kwargs):
+ super(GradingSystemForm, self).__init__(*args, **kwargs)
+ system = getattr(self, 'instance', None)
+ if system.name == 'default':
+ self.fields['name'].widget.attrs['readonly'] = True
+
+ class Meta:
+ model = GradingSystem
+ fields = ['name', 'description', 'can_be_used']