Removed ModelForm for Course and changed labels and updated widgets for the Assignment ModelForm

parent 5620d77f
from django.forms import ModelForm
from .models import Course, Assignment
class CourseForm(ModelForm):
class Meta:
model = Course
fields = "__all__"
from .models import Assignment
from django import forms
class AssignmentForm(ModelForm):
class Meta:
model = Assignment
fields = "__all__"
labels = {
'name': '',
'description': '',
'course': 'Course: ',
'perfect_score': '',
}
widgets = {
'name': forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Assignment Name'}),
'description': forms.Textarea(attrs={'class': 'form-control', 'placeholder': 'Description'}),
'course': forms.Select(attrs={'class': 'form-control', 'placeholder': 'Course'}),
'perfect_score': forms.NumberInput(attrs={'class': 'form-control', 'placeholder': 'Perfect Score'}),
'passing_score': forms.HiddenInput(),
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment