Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHORE: Add help text to CustomDocument #1673

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Generated by Django 5.0.6 on 2024-07-11 09:27
# etna:allowAlterField

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("core", "0004_customdocument"),
]

operations = [
migrations.AlterField(
model_name="customdocument",
name="description",
field=models.TextField(
blank=True,
help_text="A short summary of what the document contains to help users understand what they are downloading.",
null=True,
),
),
migrations.AlterField(
model_name="customdocument",
name="extent",
field=models.CharField(
blank=True,
help_text="The volume of the file so that users understand how much there is to consume. E.g. '3 pages' or '120 images'.",
null=True,
),
),
migrations.AlterField(
model_name="customdocument",
name="title",
field=models.CharField(
help_text="The name of the document as it will appear on the webpage. Please format this in sentence case with spaces between the words. e.g. Preservation policy part one.",
max_length=255,
verbose_name="title",
),
),
]
18 changes: 16 additions & 2 deletions etna/core/models/documents.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
import re

from django.db import models
from django.utils.translation import gettext_lazy as _

from wagtail.documents.models import AbstractDocument, Document


class CustomDocument(AbstractDocument):
extent = models.CharField(blank=True, null=True)
description = models.TextField(blank=True, null=True)
title = models.CharField(
max_length=255,
verbose_name=_("title"),
help_text="The name of the document as it will appear on the webpage. Please format this in sentence case with spaces between the words. e.g. Preservation policy part one.",
)
extent = models.CharField(
blank=True,
null=True,
help_text="The volume of the file so that users understand how much there is to consume. E.g. '3 pages' or '120 images'.",
)
description = models.TextField(
blank=True,
null=True,
help_text="A short summary of what the document contains to help users understand what they are downloading.",
)

@property
def pretty_file_size(self):
Expand Down
Loading