40 lines
886 B
Python
40 lines
886 B
Python
from django.db import models
|
|
from wagtail.core import blocks
|
|
|
|
|
|
class VideoBlock(blocks.StructBlock):
|
|
# TODO: Possible video Types for the user, upload file, add URL
|
|
title = models.CharField(max_length=255, default="")
|
|
description = models.TextField(default="")
|
|
url = blocks.URLBlock()
|
|
|
|
class Meta:
|
|
icon = 'media'
|
|
|
|
def get_api_representation(self, value, context=None):
|
|
return {'sdfsdf': 1,
|
|
'sldkfm': 3}
|
|
|
|
RISE = 'rise'
|
|
|
|
CONTENT_TYPE_CHOICES = (
|
|
(RISE, 'Rise'),
|
|
)
|
|
|
|
|
|
class WebBasedTrainingBlock(blocks.StructBlock):
|
|
url = blocks.URLBlock()
|
|
content_type = models.CharField(
|
|
max_length=255,
|
|
choices=CONTENT_TYPE_CHOICES,
|
|
default=RISE
|
|
)
|
|
|
|
class Meta:
|
|
icon = 'media'
|
|
|
|
def get_api_representation(self, value, context=None):
|
|
|
|
return {'sdfsdf': 1,
|
|
'sldkfm': 3}
|