feat: upload file in contact form

This commit is contained in:
mohamad
2026-06-07 17:09:04 +03:30
parent 76185c7434
commit cbc49cd8ae
11 changed files with 536 additions and 6 deletions
@@ -0,0 +1,30 @@
# Generated by Django 5.0.2 on 2026-06-07 13:23
import apps.pages.contact_uploads
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pages', '0012_aboutsectionitem_icon'),
]
operations = [
migrations.CreateModel(
name='ContactSubmissionAttachment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('file', models.FileField(storage=apps.pages.contact_uploads.ContactAttachmentStorage(), upload_to=apps.pages.contact_uploads.contact_attachment_upload_to)),
('original_filename', models.CharField(max_length=255)),
('uploaded_at', models.DateTimeField(auto_now_add=True)),
('submission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='pages.contactsubmission')),
],
options={
'verbose_name': 'Contact Attachment',
'verbose_name_plural': 'Contact Attachments',
'ordering': ['uploaded_at'],
},
),
]