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.
 
 
 
 

14 lines
538 B

# Create your models here.
from django.db import models
class Categorie(models.Model):
categorie_text = models.CharField(max_length=50)
def __str__(self):
return self.categorie_text
class Question(models.Model):
categorie_question = models.ForeignKey(Categorie, on_delete=models.CASCADE)
question_text = models.CharField(max_length=200)
reponse_text = models.CharField(max_length=100)
def __str__(self):
return self.question_text+" -> "+self.reponse_text+" ("+self.categorie_question.categorie_text+")"