adding relations

parent d96bc882
......@@ -58,3 +58,38 @@ class Question(models.Model):
class Takes(models.Model):
student = models.ForeignKey('Student',models.SET_NULL,blank=True,null=True)
test_ID = models.AutoField(primary_key=True)
time_stamp = models.DateTimeField(auto_now=True)
total_marks = models.FloatField(null=True)
rank = models.IntegerField
class Meta:
unique_together = (('student', 'test_ID'))
class Created_BY(models.Model):
test_ID = models.ForeignKey('Test',models.SET_NULL,blank=True,null=True)
faculty = models.ForeignKey('Faculty',models.SET_NULL,blank=True,null=True)
class Meta:
unique_together = (('faculty', 'test_ID'))
class Contains(models.Model):
test_ID = models.ForeignKey('Test',models.SET_NULL,blank=True,null=True)
q_ID = models.ForeignKey('Question',models.SET_NULL,blank=True,null=True)
marks_pos = models.FloatField(null=True)
marks_neg = models.FloatField(null=True)
class Meta:
unique_together = (('q_ID', 'test_ID'))
class Evaluvation(models.Model):
student = models.ForeignKey('Student',models.SET_NULL,blank=True,null=True)
test_ID = models.ForeignKey('Test',models.SET_NULL,blank=True,null=True)
q_ID = models.ForeignKey('Question',models.SET_NULL,blank=True,null=True)
marks = models.FloatField(null=True)
class Meta:
unique_together = (('student', 'test_ID', 'q_ID'))
\ 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