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

Experimental Modification of AbstractImage class (Work in Progress) #11792

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions wagtail/images/migrations/0027_image_image_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2024-03-24 12:08

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('wagtailimages', '0026_delete_uploadedimage'),
]

operations = [
migrations.AddField(
model_name='image',
name='image_description',
field=models.CharField(default='image description', max_length=255, verbose_name='image description'),
),
]
4 changes: 4 additions & 0 deletions wagtail/images/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ class AbstractImage(ImageFileMixin, CollectionMember, index.Indexed, models.Mode
width_field="width",
height_field="height",
)
image_description = models.CharField(
max_length=255, verbose_name=_("image description"), default="image description"
)
width = models.IntegerField(verbose_name=_("width"), editable=False)
height = models.IntegerField(verbose_name=_("height"), editable=False)
created_at = models.DateTimeField(
Expand Down Expand Up @@ -818,6 +821,7 @@ class Meta:
class Image(AbstractImage):
admin_form_fields = (
"title",
"image_description",
"file",
"collection",
"tags",
Expand Down