Commit 1d76ca5d authored by SANCHIT JAIN's avatar SANCHIT JAIN

added date time picker

parent 582642c8
...@@ -31,5 +31,9 @@ VISIBILITY_CHOICES= ('1980', '1981', '1982') ...@@ -31,5 +31,9 @@ VISIBILITY_CHOICES= ('1980', '1981', '1982')
class TestForm(forms.ModelForm): class TestForm(forms.ModelForm):
class Meta: class Meta:
model = Test model = Test
widgets = {
'expected_time_for_completion': forms.TimeInput(attrs={'type':'time'}),
'start_time': forms.DateInput(attrs={'type':'datetime-local'}),
}
exclude = ['test_ID', 'ownership'] exclude = ['test_ID', 'ownership']
\ No newline at end of file
This diff is collapsed.
...@@ -30,7 +30,7 @@ class Test(models.Model): ...@@ -30,7 +30,7 @@ class Test(models.Model):
visibility_student = models.CharField(max_length=20) visibility_student = models.CharField(max_length=20)
ownership = models.CharField(max_length=20) ownership = models.CharField(max_length=20)
expected_time_for_completion = models.DurationField(blank=True) expected_time_for_completion = models.DurationField(blank=True)
start_time = models.DateTimeField(auto_now=False, auto_now_add=False) start_time = models.DateTimeField(auto_now=False, auto_now_add=False,blank=False)
max_marks = models.IntegerField(null=True) max_marks = models.IntegerField(null=True)
# class TestQuestions(models.Model): # class TestQuestions(models.Model):
......
...@@ -8,7 +8,6 @@ Create Test ...@@ -8,7 +8,6 @@ Create Test
{%endblock%} {%endblock%}
{%block body%} {%block body%}
<h1> You CAN CREATE A Test HERE prof {{username}}</h1> <h1> You CAN CREATE A Test HERE prof {{username}}</h1>
...@@ -21,7 +20,7 @@ Create Test ...@@ -21,7 +20,7 @@ Create Test
<!-- <ul> --> <!-- <ul> -->
<form method="POST" action="create_Test"> <form method="POST" action="create_Test">
{% csrf_token %} {% csrf_token %}
{{ TestForm }} {{ TestForm.as_p }}
{{TestForm.errors}} {{TestForm.errors}}
{{TestForm.non_field_errors}} {{TestForm.non_field_errors}}
{%for question in questions%} {%for question in questions%}
......
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