Skip to content

Commit

Permalink
adding image field to events and groups model
Browse files Browse the repository at this point in the history
  • Loading branch information
David Slusser committed Sep 2, 2024
1 parent ce6b0df commit 2cec45c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/web/migrations/0014_event_image_techgroup_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.0.1 on 2024-09-02 16:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('web', '0013_event_approved_data_migration'),
]

operations = [
migrations.AddField(
model_name='event',
name='image',
field=models.ImageField(blank=True, null=True, upload_to='tech_events/'),
),
migrations.AddField(
model_name='techgroup',
name='image',
field=models.ImageField(blank=True, null=True, upload_to='techgoups/'),
),
]
3 changes: 3 additions & 0 deletions src/web/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class TechGroup(HandyHelperBaseModel):
help_text="Emojji or Font Awesome CSS icon class(es) to represent the group.",
)
tags = models.ManyToManyField(Tag, blank=True)
image = models.ImageField(upload_to="techgoups/", blank=True, null=True)

class Meta:
ordering = ["name"]
Expand Down Expand Up @@ -94,6 +95,8 @@ class Event(HandyHelperBaseModel):
group = models.ForeignKey(TechGroup, blank=True, null=True, on_delete=models.SET_NULL)
tags = models.ManyToManyField(Tag, blank=True)
approved_at = models.DateTimeField(blank=True, null=True)
image = models.ImageField(upload_to="tech_events/", blank=True, null=True)


objects = ApprovedEventManager.from_queryset(EventQuerySet)()
all = EventQuerySet.as_manager()
Expand Down

0 comments on commit 2cec45c

Please sign in to comment.