added learnpath app

This commit is contained in:
Lorenz Padberg 2022-03-28 17:41:58 +02:00
parent e2cfd19ca6
commit 45ab89ea07
7 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class LearnpathConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'learnpath'

View File

@ -0,0 +1,47 @@
# Create your models here.
import uuid
from django.db import models
class LearnBlock:
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
internal_name = models.CharField(max_length=255)
title = models.CharField(max_length=255)
class LearnPath(LearnBlock):
def __str__(self):
return f"{self.title}"
class Topic(LearnBlock):
learn_path = models.ForeignKey(LearnPath, on_delete=models.CASCADE)
is_visible = models.BooleanField(default=True)
def __str__(self):
return f"{self.title}"
class Circle(LearnBlock):
topic = models.ForeignKey(Topic, on_delete=models.CASCADE)
description = models.TextField(default="")
def __str__(self):
return f"{self.title}"
class LearnSequence(LearnBlock):
circle = models.ForeignKey(Circle, on_delete=models.CASCADE)
def __str__(self):
return f"{self.title}"
class LernUnit(LearnBlock):
learn_sequence = models.ForeignKey(LearnSequence, on_delete=models.CASCADE)
def __str__(self):
return f"{self.title}"

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.