72 lines
1.4 KiB
Python
72 lines
1.4 KiB
Python
from django.db import models
|
|
|
|
# Create your models here.
|
|
from wagtail.models import Page
|
|
from wagtail.documents.models import AbstractDocument, Document
|
|
|
|
|
|
class CustomDocument(AbstractDocument):
|
|
# Todo: check https://filepreviews.io/
|
|
|
|
# Custom field example:
|
|
display_text = models.CharField(max_length=1024, default='')
|
|
description = models.TextField(default='')
|
|
link_display_text = models.CharField(max_length=1024, default='')
|
|
thumbnail = models.URLField()
|
|
|
|
|
|
admin_form_fields = Document.admin_form_fields + (
|
|
'display_text', 'description', 'link_display_text', 'thumbnail'
|
|
)
|
|
|
|
|
|
class TopCategory(Page):
|
|
"""
|
|
Handlungsfelder
|
|
"""
|
|
parent_page_types = ['learnpath.LearningPath']
|
|
subpage_types = ['media_library.Category']
|
|
|
|
|
|
|
|
# Todo: use wagtail collections for this...
|
|
|
|
|
|
class Category(Page):
|
|
"""
|
|
Handlungsfeld
|
|
"""
|
|
|
|
parent_page_types = ['media_library.TopCategory']
|
|
|
|
#
|
|
# description
|
|
# thumbnail_image
|
|
# description_image
|
|
# additional_content # Rich text field
|
|
# documents = []
|
|
#
|
|
#
|
|
# class LibraryDocument(CustomDocument):
|
|
# """
|
|
# Extension from the standart Wagtail document.
|
|
# """
|
|
# pass
|
|
#
|
|
#
|
|
# class LibraryLink():
|
|
# """
|
|
# Custom Link Block
|
|
#
|
|
# """
|
|
# pass
|
|
#
|
|
#
|
|
# class LearningPathReference():
|
|
# icon
|
|
# pass
|
|
#
|
|
#
|
|
# class CrossReference():
|
|
# pass
|