You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Security-Quiz/quiz/models.py

14 lines
381 B

from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Answer(models.Model):
user = models.ForeignKey(User)
question = models.CharField(max_length=128)
string = models.TextField()
class Meta:
unique_together = ('user', 'question')
def __str__(self):
return self.question + ": " + self.string