Added arbitrary files and links to boxes

This commit is contained in:
2026-01-01 14:50:07 +01:00
parent acde0cb2f8
commit a4f9274da4
8 changed files with 673 additions and 15 deletions

View File

@@ -0,0 +1,41 @@
# Generated by Django 5.2.9 on 2026-01-01 13:15
import boxes.models
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('boxes', '0004_alter_thing_picture'),
]
operations = [
migrations.CreateModel(
name='ThingFile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('file', models.FileField(upload_to=boxes.models.thing_file_upload_path)),
('title', models.CharField(help_text='Descriptive name for the file', max_length=255)),
('uploaded_at', models.DateTimeField(auto_now_add=True)),
('thing', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='files', to='boxes.thing')),
],
options={
'ordering': ['-uploaded_at'],
},
),
migrations.CreateModel(
name='ThingLink',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('url', models.URLField(max_length=2048)),
('title', models.CharField(help_text='Descriptive title for the link', max_length=255)),
('uploaded_at', models.DateTimeField(auto_now_add=True)),
('thing', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='links', to='boxes.thing')),
],
options={
'ordering': ['-uploaded_at'],
},
),
]