from django import forms  
from discussion.models import Thread, Topic, Person, Subject
##
# @breif This is class which is used while creating new threads for a particular topic of a subject
##
class ThreadForm(forms.ModelForm):
	## 
	
	##
	msg = forms.CharField(widget=forms.Textarea(attrs={'class' : 'form-control send-message','rows':'3', 'placeholder':'Comment...'}))
	title = forms.CharField(widget=forms.TextInput(attrs={'class' : 'form-control send-message', 'placeholder':'Title...'}))
	class Meta:
		model = Thread
		# fields = "__all__"
		exclude = ("person","topic","likes","dislikes") 
##
# @breif This is class which is used while creating new topic for a particular subject
##
class TopicForm(forms.ModelForm):
	title = forms.CharField(widget=forms.TextInput(attrs={'class' : 'form-control send-message', 'placeholder':'Title...'}))
	class Meta:
		model = Topic
		fields = "__all__"
		exclude = ("subject",)
##
# @breif This is class which is used while creating new subject by a particular professor
##
class SubjectForm(forms.ModelForm):
	sub_code = forms.CharField(widget=forms.TextInput(attrs={'class' : 'inp-field', 'placeholder':'Subject Code...'}))
	sub_name = forms.CharField(widget=forms.TextInput(attrs={'class' : 'inp-field', 'placeholder':'Subject Title...'}))
	# sub_detail = forms.CharField(widget=forms.Textarea(attrs={'class' : 'inp-field', 'placeholder':'Details...'}))
	
	class Meta:
		model = Subject
		fields = "__all__"
		exclude = ("prof","sub_detail")
##
# @breif This is class which is used while doing signup
##
class SignupForm(forms.ModelForm):
	"""To store the User Id of Person we use pid and for storing First Name we use fname similarly for Last Name we used lname"""
	pid = forms.CharField(widget=forms.TextInput(attrs={'class' : 'inp-field', 'placeholder':'PID...'}))#To store the User Id of Person
	fname = forms.CharField(widget=forms.TextInput(attrs={'class' : 'inp-field', 'placeholder':'First Name...'}))#To store the Fisrt Name of Person
	lname = forms.CharField(widget=forms.TextInput(attrs={'class' : 'inp-field', 'placeholder':'Last name...'}))#To store the Last Name of Person
	password = forms.CharField(widget=forms.TextInput(attrs={'class' : 'inp-field', 'placeholder':'Password...', 'type':'password'}))##To store the Password of Person
	
	class Meta:
		model = Person
		fields = "__all__"
##
# @breif This is class which is used while doing login
##
class LoginForm(forms.ModelForm):
	pid = forms.CharField(widget=forms.TextInput(attrs={'class' : 'inp-field', 'placeholder':'PID...'}))#To store the User Id of Person
	password = forms.CharField(widget=forms.TextInput(attrs={'class' : 'inp-field', 'placeholder':'Password...', 'type':'password'}))
	
	class Meta:
		model = Person
		fields = ('pid', 'password')

