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
|
|
|
|
2021-02-04 18:47:03 +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 = [
|
|
|
|
('bookwyrm', '0040_auto_20210122_0057'),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='List',
|
|
|
|
fields=[
|
|
|
|
('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)),
|
2021-01-31 16:41:11 +00:00
|
|
|
('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={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
2021-02-04 18:47:03 +00:00
|
|
|
bases=(bookwyrm.models.activitypub_mixin.OrderedCollectionMixin, models.Model),
|
2021-01-31 05:00:36 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='ListItem',
|
|
|
|
fields=[
|
|
|
|
('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)),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'ordering': ('-created_date',),
|
|
|
|
'unique_together': {('book', 'book_list')},
|
|
|
|
},
|
2021-02-04 18:47:03 +00:00
|
|
|
bases=(bookwyrm.models.activitypub_mixin.ActivitypubMixin, models.Model),
|
2021-01-31 05:00:36 +00:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='list',
|
|
|
|
name='books',
|
|
|
|
field=models.ManyToManyField(through='bookwyrm.ListItem', to='bookwyrm.Edition'),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='list',
|
|
|
|
name='user',
|
|
|
|
field=bookwyrm.models.fields.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
|
|
|
|
),
|
|
|
|
]
|