mirror of
https://github.com/daniviga/django-ram.git
synced 2025-12-26 15:28:31 +01:00
Add support for magazines, backend only (#53)
* Initial work to support magazines * Change editor default height to 300px from 500px * Stabilize the magazine repository app * Switch from stacked to tabular inlines for magazines * Update submodules
This commit is contained in:
65
ram/repository/migrations/0004_magazineissuedocument.py
Normal file
65
ram/repository/migrations/0004_magazineissuedocument.py
Normal file
@@ -0,0 +1,65 @@
|
||||
# Generated by Django 6.0 on 2025-12-08 17:47
|
||||
|
||||
import django.db.models.deletion
|
||||
import ram.utils
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookshelf", "0025_magazine_magazineissue"),
|
||||
(
|
||||
"repository",
|
||||
"0003_alter_bookdocument_file_alter_catalogdocument_file_and_more",
|
||||
),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="MagazineIssueDocument",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("description", models.CharField(blank=True, max_length=128)),
|
||||
(
|
||||
"file",
|
||||
models.FileField(
|
||||
storage=ram.utils.DeduplicatedStorage, upload_to="files/"
|
||||
),
|
||||
),
|
||||
("creation_time", models.DateTimeField(auto_now_add=True)),
|
||||
("updated_time", models.DateTimeField(auto_now=True)),
|
||||
(
|
||||
"private",
|
||||
models.BooleanField(
|
||||
default=False,
|
||||
help_text="Document will be visible only to logged users",
|
||||
),
|
||||
),
|
||||
(
|
||||
"issue",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="document",
|
||||
to="bookshelf.magazineissue",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name_plural": "Magazines documents",
|
||||
"constraints": [
|
||||
models.UniqueConstraint(
|
||||
fields=("issue", "file"), name="unique_issue_file"
|
||||
)
|
||||
],
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user