Skip to content

Commit

Permalink
More Forms added
Browse files Browse the repository at this point in the history
  • Loading branch information
Marin-Tony committed Apr 28, 2021
1 parent 2a2fa3e commit f5b7f55
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions recognition/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
from django.contrib.auth.models import User
from django import forms
from datetime import datetime
from users.models import staff_mesg,desig,Notify,Time,Present
from users.models import staff_mesg,desig,Notify,Time,Present,faculty_details,course_details,add_marks,add_remarks

GEEKS_CHOICES =((1,"Teacher"),(2,"Parent_Student"),(3,"Staff"))
DESIGNATION_CHOICES=[('teacher','Teacher'),('parent_student','Parent_Student'),('staff','Staff')]
#SUBJECT_CHOICES=[('dbms','DBMS'),('sql','SQL'),('python','Python'),('java','Java'),('maths','Maths'),('aws','AWS')]

class checkForm(forms.Form):
username=forms.CharField(max_length=30)
class checkForm(forms.ModelForm):

notification=forms.CharField(widget=forms.Textarea(),label='Notification')
class Meta:
model = Notify
fields=['username','notification']
fields=['notification']


class TextAreaForm(forms.ModelForm):
Expand All @@ -35,9 +34,37 @@ class Meta:
model = desig
fields = ['username','designation']

class DateForm_2(forms.Form):
date_from=forms.DateField(label='Date:',widget = forms.SplitDateTimeWidget(date_format=datetime.now()))
class courseForm(forms.ModelForm):
course_name=forms.CharField(label='Course Name',max_length=50)
Eligibility = forms.CharField(max_length=30)
semester = forms.CharField(max_length=3)
Duration= forms.CharField(max_length=10)
class Meta:
model = course_details
fields = ['course_name','Eligibility','semester','Duration']

class facultyForm(forms.ModelForm):
Name = forms.CharField(max_length=30)
Qualification = forms.CharField(max_length=30)
Department = forms.CharField(max_length=30)
position = forms.CharField(max_length=30)
date_of_joining = forms.DateField(widget = forms.SelectDateWidget(empty_label=("Choose Year", "Choose Month", "Choose Day")))



class Meta:
model = faculty_details
fields = ['Name','Qualification','Department','position','date_of_joining']

class marksForm(forms.ModelForm):
Student_name = forms.CharField(max_length=30,label='Student Name')
Subject = forms.CharField(max_length=20)
Marks = forms.IntegerField()
Total = forms.IntegerField()
class Meta:
model = add_marks
fields = ['Student_name','Subject','Marks','Total']
class remarksForm(forms.ModelForm):
Student_name = forms.CharField(max_length=30,label='Student Name')
Remarks = forms.CharField(widget=forms.Textarea())
class Meta:
model = add_remarks
fields = ['Student_name','Remarks']

0 comments on commit f5b7f55

Please sign in to comment.