-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforms.py
More file actions
29 lines (25 loc) · 909 Bytes
/
forms.py
File metadata and controls
29 lines (25 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- coding: utf-8 -*-
from django import forms
from django.forms import ModelForm
from mark.models import Students
from models import Labs
class StudentForm(ModelForm):
def as_p(self):
return self._html_output(
normal_row = u'<p%(html_class_attr)s>%(field)s %(label)s%(help_text)s</p>',
error_row = u'%s',
row_ender = '</p>',
help_text_html = u' <span class="helptext">%s</span>',
errors_on_separate_row = True)
class Meta:
model = Students
class LabForm(ModelForm):
def as_p(self):
return self._html_output(
normal_row = u'<p%(html_class_attr)s>%(field)s %(label)s%(help_text)s</p>',
error_row = u'%s',
row_ender = '</p>',
help_text_html = u' <span class="helptext">%s</span>',
errors_on_separate_row = True)
class Meta:
model = Labs