event guest

This commit is contained in:
Dominic 2025-03-30 22:29:59 -04:00
parent 907728fdfb
commit 330b22daf7
5 changed files with 63 additions and 2 deletions

Binary file not shown.

View File

@ -9,7 +9,9 @@ from web.models import (
EventDivision,
EventDivisionAdmin,
SharedEvent,
SharedEventAdmin
SharedEventAdmin,
EventGuest,
EventGuestAdmin
)
@ -19,3 +21,4 @@ admin.site.register(EventComment)
admin.site.register(EventCommentReaction, EventCommentReactionAdmin)
admin.site.register(EventDivision, EventDivisionAdmin)
admin.site.register(SharedEvent, SharedEventAdmin)
admin.site.register(EventGuest, EventGuestAdmin)

View File

@ -0,0 +1,38 @@
# Generated by Django 4.2.16 on 2025-03-31 02:28
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('web', '0003_alter_event_participants'),
]
operations = [
migrations.RemoveField(
model_name='event',
name='participants',
),
migrations.AlterField(
model_name='eventcomment',
name='event',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='web.event'),
),
migrations.CreateModel(
name='EventGuest',
fields=[
('created_at', models.DateTimeField(auto_now_add=True, null=True)),
('updated_at', models.DateTimeField(auto_now=True, null=True)),
('active', models.BooleanField(default=True)),
('id', models.AutoField(primary_key=True, serialize=False)),
('guest_email', models.TextField()),
('guest_hash', models.TextField()),
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='web.event')),
],
options={
'db_table': 'event_guests',
},
),
]

View File

@ -4,4 +4,4 @@ from .event_comment import EventComment, EventCommentAdmin
from .event_comment_reaction import EventCommentReaction, EventCommentReactionAdmin
from .event_division import EventDivision, EventDivisionAdmin
from .shared_event import SharedEvent, SharedEventAdmin
from .event_guest import EventGuest, EventGuestAdmin

20
web/models/event_guest.py Normal file
View File

@ -0,0 +1,20 @@
from django.contrib import admin
from django.contrib.auth.models import User
from django.db import models
from web.models.base import BaseModel
from web.models.event import Event
class EventGuest(BaseModel):
id = models.AutoField(primary_key=True)
event = models.ForeignKey(Event, on_delete=models.CASCADE)
guest_email = models.TextField(blank=False, null=False)
guest_hash = models.TextField(blank=False, null=False)
class Meta:
db_table = 'event_guests'
class EventGuestAdmin(admin.ModelAdmin):
list_display = ('event', 'guest_email', 'guest_hash')