moviewyrm/bookwyrm/migrations/0041_auto_20210131_1614.py

151 lines
5.2 KiB
Python
Raw Normal View History

2021-01-31 16:41:11 +00:00
# Generated by Django 3.0.7 on 2021-01-31 16:14
2021-01-31 05:00:36 +00:00
import bookwyrm.models.activitypub_mixin
2021-01-31 05:00:36 +00:00
import bookwyrm.models.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
2021-03-08 16:49:10 +00:00
("bookwyrm", "0040_auto_20210122_0057"),
2021-01-31 05:00:36 +00:00
]
operations = [
migrations.CreateModel(
2021-03-08 16:49:10 +00:00
name="List",
2021-01-31 05:00:36 +00:00
fields=[
2021-03-08 16:49:10 +00:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_date", models.DateTimeField(auto_now_add=True)),
("updated_date", models.DateTimeField(auto_now=True)),
(
"remote_id",
bookwyrm.models.fields.RemoteIdField(
max_length=255,
null=True,
validators=[bookwyrm.models.fields.validate_remote_id],
),
),
("name", bookwyrm.models.fields.CharField(max_length=100)),
(
"description",
bookwyrm.models.fields.TextField(blank=True, null=True),
),
(
"privacy",
bookwyrm.models.fields.CharField(
choices=[
("public", "Public"),
("unlisted", "Unlisted"),
("followers", "Followers"),
("direct", "Direct"),
],
default="public",
max_length=255,
),
),
(
"curation",
bookwyrm.models.fields.CharField(
choices=[
("closed", "Closed"),
("open", "Open"),
("curated", "Curated"),
],
default="closed",
max_length=255,
),
),
2021-01-31 05:00:36 +00:00
],
options={
2021-03-08 16:49:10 +00:00
"abstract": False,
2021-01-31 05:00:36 +00:00
},
2021-03-08 16:49:10 +00:00
bases=(
bookwyrm.models.activitypub_mixin.OrderedCollectionMixin,
models.Model,
),
2021-01-31 05:00:36 +00:00
),
migrations.CreateModel(
2021-03-08 16:49:10 +00:00
name="ListItem",
2021-01-31 05:00:36 +00:00
fields=[
2021-03-08 16:49:10 +00:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_date", models.DateTimeField(auto_now_add=True)),
("updated_date", models.DateTimeField(auto_now=True)),
(
"remote_id",
bookwyrm.models.fields.RemoteIdField(
max_length=255,
null=True,
validators=[bookwyrm.models.fields.validate_remote_id],
),
),
("notes", bookwyrm.models.fields.TextField(blank=True, null=True)),
("approved", models.BooleanField(default=True)),
("order", bookwyrm.models.fields.IntegerField(blank=True, null=True)),
(
"added_by",
bookwyrm.models.fields.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
to=settings.AUTH_USER_MODEL,
),
),
(
"book",
bookwyrm.models.fields.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
to="bookwyrm.Edition",
),
),
(
"book_list",
bookwyrm.models.fields.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="bookwyrm.List"
),
),
(
"endorsement",
models.ManyToManyField(
related_name="endorsers", to=settings.AUTH_USER_MODEL
),
),
2021-01-31 05:00:36 +00:00
],
options={
2021-03-08 16:49:10 +00:00
"ordering": ("-created_date",),
"unique_together": {("book", "book_list")},
2021-01-31 05:00:36 +00:00
},
bases=(bookwyrm.models.activitypub_mixin.ActivitypubMixin, models.Model),
2021-01-31 05:00:36 +00:00
),
migrations.AddField(
2021-03-08 16:49:10 +00:00
model_name="list",
name="books",
field=models.ManyToManyField(
through="bookwyrm.ListItem", to="bookwyrm.Edition"
),
2021-01-31 05:00:36 +00:00
),
migrations.AddField(
2021-03-08 16:49:10 +00:00
model_name="list",
name="user",
field=bookwyrm.models.fields.ForeignKey(
on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL
),
2021-01-31 05:00:36 +00:00
),
]