Skip to content

Commit

Permalink
update abstracted Publication model, on optionnal and required field
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Sep 24, 2024
1 parent e015948 commit d7d612e
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Generated by Django 5.0.9 on 2024-09-24 13:03

import storages.backends.s3
from django.db import migrations, models

import lacommunaute.utils.validators


class Migration(migrations.Migration):
dependencies = [
("documentation", "0001_initial"),
]

operations = [
migrations.AlterField(
model_name="category",
name="image",
field=models.ImageField(
blank=True,
null=True,
storage=storages.backends.s3.S3Storage(bucket_name="private-bucket", file_overwrite=False),
upload_to="",
validators=[lacommunaute.utils.validators.validate_image_size],
),
),
migrations.AlterField(
model_name="category",
name="short_description",
field=models.CharField(default="to be updated", max_length=400, verbose_name="Short Description"),
preserve_default=False,
),
migrations.AlterField(
model_name="document",
name="image",
field=models.ImageField(
blank=True,
null=True,
storage=storages.backends.s3.S3Storage(bucket_name="private-bucket", file_overwrite=False),
upload_to="",
validators=[lacommunaute.utils.validators.validate_image_size],
),
),
migrations.AlterField(
model_name="document",
name="short_description",
field=models.CharField(default="to be updated", max_length=400, verbose_name="Short Description"),
preserve_default=False,
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 5.0.9 on 2024-09-24 13:03

import storages.backends.s3
from django.db import migrations, models

import lacommunaute.utils.validators


class Migration(migrations.Migration):
dependencies = [
("partner", "0004_remove_partner_logo_partner_image_alter_partner_name_and_more"),
]

operations = [
migrations.AlterField(
model_name="partner",
name="image",
field=models.ImageField(
blank=True,
null=True,
storage=storages.backends.s3.S3Storage(bucket_name="private-bucket", file_overwrite=False),
upload_to="",
validators=[lacommunaute.utils.validators.validate_image_size],
),
),
migrations.AlterField(
model_name="partner",
name="short_description",
field=models.CharField(default="to be updated", max_length=400, verbose_name="Short Description"),
preserve_default=False,
),
]
4 changes: 3 additions & 1 deletion lacommunaute/utils/abstract_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ class Publication(DatedModel):
slug = models.SlugField(max_length=255, verbose_name=_("Slug"), unique=True)

description = MarkupTextField(verbose_name=_("Description"), null=True, blank=True)
short_description = models.CharField(max_length=400, blank=True, null=True, verbose_name=_("Short Description"))
short_description = models.CharField(max_length=400, verbose_name=_("Short Description"))
image = models.ImageField(
storage=S3Boto3Storage(bucket_name=settings.AWS_STORAGE_BUCKET_NAME, file_overwrite=False),
validators=[validate_image_size],
blank=True,
null=True,
)

class Meta:
Expand Down

0 comments on commit d7d612e

Please sign in to comment.