from django.db import models
from markdownx.models import MarkdownxField

# Create your models here.


class Tutorial(models.Model):
    # ToDo: Fields that are out-commented are missing according to the mockup -> datamodel ??

    # Category = models.TextField()
    title = models.TextField()
    html = models.TextField()
    markdown = MarkdownxField()
    # Level = models.IntegerField()

@@ -22,16 +22,49 @@
  models%0A
+from django.urls import reverse%0A%0A
 from mar
@@ -100,16 +100,150 @@
 xField%0A%0A
+# add options if needed%0ACATEGORY_OPTIONS = %5B('io', 'I/O'), ('intro', 'Introduction')%5D%0ALEVEL_OPTIONS = %5B(1, '1'), (2, '2'), (3, '3')%5D%0A%0A
 # Create
@@ -262,17 +262,16 @@
  here.%0A%0A
-%0A
 class Tu
@@ -391,19 +391,17 @@
 ??%0A%0A    
-# C
+c
 ategory 
@@ -405,34 +405,85 @@
 ry = models.
-TextField(
+CharField(max_length=15, choices=CATEGORY_OPTIONS, blank=True
 )%0A    title 
@@ -573,11 +573,9 @@
     
-# L
+l
 evel
@@ -593,14 +593,138 @@
 ntegerField(
+choices=LEVEL_OPTIONS, null=True)%0A%0A    def get_absolute_url (self):%0A        return reverse('detail_tutorial', args=%5Bself.id%5D
 )%0A

Add options for choices fields, Add new fields to Tutorial model