Add custom Document Model (No migration)
This commit is contained in:
parent
9fea218dd3
commit
4d13d5e42d
|
|
@ -0,0 +1,9 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Iterativ GmbH
|
||||||
|
# http://www.iterativ.ch/
|
||||||
|
#
|
||||||
|
# Copyright (c) 2015 Iterativ GmbH. All rights reserved.
|
||||||
|
#
|
||||||
|
# Created on 2022-07-28
|
||||||
|
# @author: lorenz.padberg@iterativ.ch
|
||||||
|
|
@ -4,3 +4,4 @@ from .topic import *
|
||||||
from .chapter import *
|
from .chapter import *
|
||||||
from .contentblock import *
|
from .contentblock import *
|
||||||
from .snapshot import *
|
from .snapshot import *
|
||||||
|
from .custom_document import *
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
from wagtail.documents.models import Document, AbstractDocument
|
||||||
|
|
||||||
|
|
||||||
|
class CustomDocument(AbstractDocument):
|
||||||
|
# Custom field example:
|
||||||
|
display_text = models.CharField(
|
||||||
|
max_length=1024, default='')
|
||||||
|
|
||||||
|
admin_form_fields = Document.admin_form_fields + (
|
||||||
|
'display_text',
|
||||||
|
)
|
||||||
|
|
@ -362,6 +362,8 @@ GRAPHENE = {
|
||||||
|
|
||||||
# http://docs.wagtail.io/en/v2.1/advanced_topics/settings.html?highlight=urls
|
# http://docs.wagtail.io/en/v2.1/advanced_topics/settings.html?highlight=urls
|
||||||
WAGTAIL_SITE_NAME = 'skillbox'
|
WAGTAIL_SITE_NAME = 'skillbox'
|
||||||
|
WAGTAILDOCS_DOCUMENT_MODEL = 'books.CustomDocument'
|
||||||
|
|
||||||
|
|
||||||
GRAPHQL_QUERIES_DIR = os.path.join(BASE_DIR, '..', 'client', 'src', 'graphql', 'gql', 'queries')
|
GRAPHQL_QUERIES_DIR = os.path.join(BASE_DIR, '..', 'client', 'src', 'graphql', 'gql', 'queries')
|
||||||
GRAPHQL_MUTATIONS_DIR = os.path.join(GRAPHQL_QUERIES_DIR, '../mutations')
|
GRAPHQL_MUTATIONS_DIR = os.path.join(GRAPHQL_QUERIES_DIR, '../mutations')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue