first
This commit is contained in:
commit
fa9d154db9
260 files changed
+17643
No files matched your search
@@ -0,0 +1,49 @@
|
||||
# Generated by Django 5.1.1 on 2026-09-05 07:03
|
||||
|
||||
import apps.attachments.models
|
||||
import uuid
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Attachment',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('public_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
|
||||
('file', models.FileField(upload_to=apps.attachments.models.attachment_path)),
|
||||
('original_name', models.CharField(max_length=255)),
|
||||
('stored_name', models.CharField(max_length=255)),
|
||||
('relative_path', models.CharField(max_length=500)),
|
||||
('attachment_type', models.CharField(choices=[('IMAGE', 'تصویر'), ('VIDEO', 'ویدئو'), ('VOICE', 'صدا'), ('PDF', 'PDF'), ('WORD', 'Word'), ('EXCEL', 'Excel'), ('ZIP', 'ZIP'), ('RAR', 'RAR'), ('OTHER', 'سایر')], max_length=20)),
|
||||
('mime_type', models.CharField(max_length=150)),
|
||||
('extension', models.CharField(max_length=20)),
|
||||
('file_size', models.PositiveBigIntegerField()),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'permissions': [('download_attachment', 'Can download attachment'), ('manage_attachment_policy', 'Can manage attachment policy')],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='AttachmentPolicy',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('attachment_type', models.CharField(max_length=20, unique=True)),
|
||||
('is_enabled', models.BooleanField(default=True)),
|
||||
('max_file_size', models.PositiveBigIntegerField()),
|
||||
('max_files_per_message', models.PositiveSmallIntegerField(default=10)),
|
||||
('allowed_extensions', models.JSONField(default=list)),
|
||||
('allowed_mime_types', models.JSONField(default=list)),
|
||||
('sort_order', models.PositiveIntegerField(default=0)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
),
|
||||
]
|
||||
Reference in new issue
Block a user