from django.db import models
from django.urls import reverse

# add options if needed
CATEGORY_OPTIONS = [('io', 'I/O'), ('intro', 'Introduction')]
LEVEL_OPTIONS = [(1, 'Beginners'), (2, 'Intermediates'), (3, 'Advanced')]

# Create your models here.


class Tutorial(models.Model):

    category = models.CharField(max_length=15, choices=CATEGORY_OPTIONS, blank=True)
    title = models.CharField(max_length=255)
    html = models.TextField()
    # make sure to use official embed links
    media_src = models.URLField(null=True, blank=True)
    markdown = models.TextField()
    level = models.IntegerField(choices=LEVEL_OPTIONS, null=True)

    def get_absolute_url (self):
        return reverse('detail_tutorial', args=[self.id])

@@ -171,17 +171,16 @@
 Beginner
-s
 '), (2, 
@@ -192,17 +192,16 @@
 rmediate
-s
 '), (3, 
@@ -205,16 +205,223 @@
 3, '
-Advanced
+Expert')%5D%0ALANGUAGE = %5B('de', 'german'), ('en', 'english'), ('fr', 'french')%5D%0ALICENSE = %5B('none', 'No'), ('cc0', 'CC0'), ('agpl', 'AGPL')%5D%0AMEDIUM = %5B('video', 'video'), ('text', 'text'), ('jupyter', 'jupyter notebook
 ')%5D%0A
@@ -717,16 +717,50 @@
 RLField(
+verbose_name='youtube video url', 
 null=Tru
@@ -874,16 +874,292 @@
 l=True)%0A
+    language = models.CharField(choices=LANGUAGE, null=True)%0A    medium = models.CharField(choices=MEDIUM, null=True)%0A    email_contact = models.EmailField(verbose_name='email contact', max_length=255)%0A    github = models.CharField(verbose_name='github name', max_length=50)%0A%0A
 %0A    def

add new coices to extend the form