Commit 73f79c4c authored by Benoit Alessandroni's avatar Benoit Alessandroni

Adding proper request and review models

parent 72ec4e7c
......@@ -4,16 +4,22 @@ from .models import Resource
from .models import Step
from .models import Field
from .models import Format
from .models import Type
from .models import Entrepreneur
from .models import Mentor
from .models import Organisation
from .models import Language
from .models import Review
from .models import Request
......@@ -101,3 +101,27 @@ class Resource (Model):
def __str__(self):
return self.title
class Request (Model):
# Mandatory Fields
title = models.CharField(max_length=32, verbose_name="Title")
description = models.TextField(verbose_name="Description")
language = models.ForeignKey(Language, blank=True, verbose_name="Language")
field = models.ManyToManyField(Field, blank=True)
country = CountryField(verbose_name="Country of publication", blank=True)
organisation = models.ForeignKey(Organisation, on_delete=models.CASCADE)
skills = models.TextField(verbose_name="Learning outcomes/skills")
def __str__(self):
return self.title
class Review (Model):
resource = models.ForeignKey(Resource, verbose_name="Associated resource", blank=True)
comment = models.TextField(verbose_name="Comment")
status = models.CharField(max_length=32, choices=(('inappropriate', 'Inappropriate'), ('validated', 'Validated'), ('to_improve', 'Improvement required')), verbose_name="Resource status", blank=True, null=True)
def __str__(self):
return self.title
\ 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