52 lines
1.1 KiB
Python
52 lines
1.1 KiB
Python
from django.db import models
|
|
from wagtail.core import blocks
|
|
from wagtail.api import APIField
|
|
|
|
|
|
# 'video_block'
|
|
class VideoBlock(blocks.StructBlock):
|
|
# TODO: Possible video Types for the user, upload file, add URL
|
|
title = models.CharField(max_length=128, 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'),
|
|
)
|
|
|
|
# 'Web based training Block'
|
|
class WebBasedTrainingBlock(blocks.StructBlock):
|
|
|
|
url = blocks.URLBlock()
|
|
content_type = models.CharField(
|
|
max_length=100,
|
|
choices=CONTENT_TYPE_CHOICES,
|
|
default=RISE
|
|
)
|
|
|
|
class Meta:
|
|
icon = 'media'
|
|
|
|
def get_api_representation(self, value, context=None):
|
|
|
|
return {'sdfsdf': 1,
|
|
'sldkfm': 3}
|
|
|
|
|
|
# 'Transver Task'
|
|
class TranverTaskBlock(blocks.StructBlock):
|
|
title = models.CharField(max_length=128, default="")
|
|
description = models.TextField(default="")
|
|
|
|
class Meta:
|
|
icon = 'media'
|