added learnpath app
This commit is contained in:
parent
e2cfd19ca6
commit
45ab89ea07
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class LearnpathConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'learnpath'
|
||||||
|
|
@ -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}"
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
||||||
Loading…
Reference in New Issue