|
|
|
|
@ -1,5 +1,8 @@ |
|
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
|
import datetime |
|
|
|
|
|
|
|
|
|
from django.contrib.contenttypes.fields import GenericForeignKey |
|
|
|
|
from django.contrib.contenttypes.models import ContentType |
|
|
|
|
from django.db import models |
|
|
|
|
from redactor.fields import RedactorField |
|
|
|
|
|
|
|
|
|
@ -975,6 +978,33 @@ class Flow(models.Model): |
|
|
|
|
ordering = ['-modified'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Модели нового API со временем всё, что выше будет выпилено |
|
|
|
|
class Tutorial(models.Model): |
|
|
|
|
on_comment = models.BooleanField(verbose_name=u'Комментарии', default=True) |
|
|
|
|
video = models.TextField(verbose_name=u'Код видео', default='', blank=True) |
|
|
|
|
materials = models.ManyToManyField(Storage, verbose_name=u'Материалы урока', blank=True) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Task(models.Model): |
|
|
|
|
materials = models.ManyToManyField(Storage, verbose_name=u'Материалы для домашней работы', blank=True) |
|
|
|
|
is_exam = models.BooleanField(default=False, verbose_name=u'Экзамен или домашка') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Topic(models.Model): |
|
|
|
|
icon = models.ImageField(verbose_name=u'Иконка темы', upload_to='CourseTheme', null=True, blank=True) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Vertex(models.Model): |
|
|
|
|
course = models.ForeignKey(to=Course) |
|
|
|
|
title = models.CharField(verbose_name=u'Название', max_length=255) |
|
|
|
|
description = models.TextField( |
|
|
|
|
verbose_name=u'Описание', default='', blank=True, null=True) |
|
|
|
|
children = models.ManyToManyField(to='Vertex', blank=True) |
|
|
|
|
content_type = models.ForeignKey(to=ContentType) |
|
|
|
|
object_id = models.PositiveIntegerField() |
|
|
|
|
content_object = GenericForeignKey('content_type', 'object_id') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NormalMap(models.Model): |
|
|
|
|
course = models.OneToOneField(to=Course) |
|
|
|
|
json_tree = models.TextField(default='') |
|
|
|
|
|